1200
|
Is it possible to display the task bars with a gradient color
![](images/exg2anttq1200.png)
with G2antt1 do
begin
BeginUpdate();
with Chart do
begin
FirstVisibleDate := '12/31/2009';
LevelCount := 2;
PaneWidth[False] := 96;
Bars.Copy('Task','TaskO');
with Bars.Item['Task'] do
begin
Pattern := Integer(EXG2ANTTLib_TLB.exPatternGradientVBox) Or Integer(EXG2ANTTLib_TLB.exPatternBox) Or Integer(EXG2ANTTLib_TLB.exPatternShadow);
StartColor := $ffffff;
EndColor := Color;
end;
end;
Columns.Add('Types');
with Items do
begin
AddBar(AddItem('Original'),'TaskO','1/4/2010','1/9/2010','',Null);
AddBar(AddItem('Pattern Gradient'),'Task','1/4/2010','1/9/2010','',Null);
AddBar(AddItem('Original'),'TaskO','1/4/2010','1/9/2010','',Null);
end;
EndUpdate();
end
|
1199
|
How can I know the type of bars I can displays using predefined patterns
![](images/exg2anttq1199.png)
with G2antt1 do
begin
BeginUpdate();
with Chart do
begin
FirstVisibleDate := '12/31/2009';
LevelCount := 2;
PaneWidth[False] := 96;
with Bars do
begin
Add('Box').Pattern := EXG2ANTTLib_TLB.exPatternBox;
Add('ThickBox').Pattern := Integer(EXG2ANTTLib_TLB.exPatternThickBox) Or Integer(EXG2ANTTLib_TLB.exPatternBox);
Add('DiagBox').Pattern := Integer(EXG2ANTTLib_TLB.exPatternThickBox) Or Integer(EXG2ANTTLib_TLB.exPatternBDiagonal);
Copy('Task','Shadow').Pattern := Integer(EXG2ANTTLib_TLB.exPatternFrameShadow) Or Integer(EXG2ANTTLib_TLB.exPatternShadow);
Copy('Task','TShadow').Pattern := Integer(EXG2ANTTLib_TLB.exPatternFrameShadow) Or Integer(EXG2ANTTLib_TLB.exPatternThickBox) Or Integer(EXG2ANTTLib_TLB.exPatternDiagCross);
with Add('HGrad1') do
begin
Pattern := EXG2ANTTLib_TLB.exPatternBox;
StartColor := $ffffff;
EndColor := $ff0000;
end;
with Add('HGrad2') do
begin
Pattern := Integer(EXG2ANTTLib_TLB.exPatternBox) Or Integer(EXG2ANTTLib_TLB.exPatternShadow);
StartColor := $ffffff;
EndColor := $ff0000;
Color := $ff0000;
end;
with Add('HGrad3') do
begin
Pattern := Integer(EXG2ANTTLib_TLB.exPatternGradient3Colors) Or Integer(EXG2ANTTLib_TLB.exPatternBox) Or Integer(EXG2ANTTLib_TLB.exPatternShadow);
StartColor := $ffffff;
EndColor := StartColor;
Color := $ff0000;
end;
with Add('HGrad4') do
begin
Pattern := Integer(EXG2ANTTLib_TLB.exPatternThickBox) Or Integer(EXG2ANTTLib_TLB.exPatternGradient3Colors) Or Integer(EXG2ANTTLib_TLB.exPatternBox);
StartColor := $ffffff;
EndColor := StartColor;
Color := $ff0000;
end;
with Add('HGrad5') do
begin
Pattern := Integer(EXG2ANTTLib_TLB.exPatternFrameShadow) Or Integer(EXG2ANTTLib_TLB.exPatternGradient3Colors) Or Integer(EXG2ANTTLib_TLB.exPatternBox);
StartColor := $ff00;
EndColor := $ff;
Color := $ff0000;
end;
with Add('VGrad1') do
begin
Pattern := Integer(EXG2ANTTLib_TLB.exPatternGradientVBox) Or Integer(EXG2ANTTLib_TLB.exPatternBox);
StartColor := $ffffff;
EndColor := $ff0000;
Height := 14;
end;
with Add('VGrad2') do
begin
Pattern := Integer(EXG2ANTTLib_TLB.exPatternGradientVBox) Or Integer(EXG2ANTTLib_TLB.exPatternBox) Or Integer(EXG2ANTTLib_TLB.exPatternShadow);
StartColor := $ffffff;
EndColor := $ff0000;
Color := $ff0000;
Height := 14;
end;
with Add('VGrad3') do
begin
Pattern := Integer(EXG2ANTTLib_TLB.exPatternGradient3Colors) Or Integer(EXG2ANTTLib_TLB.exPatternGradientVBox) Or Integer(EXG2ANTTLib_TLB.exPatternBox) Or Integer(EXG2ANTTLib_TLB.exPatternShadow);
StartColor := $ffffff;
EndColor := StartColor;
Color := $ff0000;
Height := 14;
end;
with Add('VGrad4') do
begin
Pattern := Integer(EXG2ANTTLib_TLB.exPatternThickBox) Or Integer(EXG2ANTTLib_TLB.exPatternGradient3Colors) Or Integer(EXG2ANTTLib_TLB.exPatternGradientVBox) Or Integer(EXG2ANTTLib_TLB.exPatternBox);
StartColor := $ffffff;
EndColor := StartColor;
Color := $ff0000;
Height := -1;
end;
with Add('VGrad5') do
begin
Pattern := Integer(EXG2ANTTLib_TLB.exPatternFrameShadow) Or Integer(EXG2ANTTLib_TLB.exPatternGradient3Colors) Or Integer(EXG2ANTTLib_TLB.exPatternGradientVBox) Or Integer(EXG2ANTTLib_TLB.exPatternBox);
StartColor := $ff00;
EndColor := $ff;
Color := $ff0000;
Height := 14;
end;
end;
end;
Columns.Add('Types');
with Items do
begin
AddBar(AddItem('Box'),'Box','1/4/2010','1/9/2010','',Null);
AddBar(AddItem('Thick Box'),'ThickBox','1/4/2010','1/9/2010','',Null);
AddBar(AddItem('Thick Box Diag'),'DiagBox','1/4/2010','1/9/2010','',Null);
AddBar(AddItem('Shadow'),'Shadow','1/4/2010','1/9/2010','',Null);
AddBar(AddItem('Thick Shadow'),'TShadow','1/4/2010','1/9/2010','',Null);
AddBar(AddItem('Solid Gradient'),'HGrad1','1/4/2010','1/9/2010','',Null);
AddBar(AddItem('Pattern Gradient'),'HGrad2','1/4/2010','1/9/2010','',Null);
AddBar(AddItem('Pattern Gradient 3 Colors'),'HGrad3','1/4/2010','1/9/2010','',Null);
AddBar(AddItem('Solid Gradient 3 Colors'),'HGrad4','1/4/2010','1/9/2010','',Null);
AddBar(AddItem('Gradient Shadow'),'HGrad5','1/4/2010','1/9/2010','',Null);
AddBar(AddItem('Solid Gradient'),'VGrad1','1/4/2010','1/9/2010','',Null);
AddBar(AddItem('Pattern Gradient'),'VGrad2','1/4/2010','1/9/2010','',Null);
AddBar(AddItem('Pattern Gradient 3 Colors'),'VGrad3','1/4/2010','1/9/2010','',Null);
AddBar(AddItem('Solid Gradient 3 Colors'),'VGrad4','1/4/2010','1/9/2010','',Null);
AddBar(AddItem('Gradient Shadow'),'VGrad5','1/4/2010','1/9/2010','',Null);
end;
EndUpdate();
end
|
1198
|
Is it possible to display the bars with a thicker border
![](images/exg2anttq1198.png)
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Task');
Chart.FirstVisibleDate := '1/1/2001';
Chart.PaneWidth[False] := 48;
Chart.Bars.Copy('Task','TaskB').Pattern := Integer(EXG2ANTTLib_TLB.exPatternThickBox) Or Integer(EXG2ANTTLib_TLB.exPatternShadow);
with Items do
begin
AddBar(AddItem('Task 1'),'Task','1/2/2001','1/5/2001','',Null);
AddBar(AddItem('Task 2'),'TaskB','1/2/2001','1/5/2001','',Null);
AddBar(AddItem('Task 3'),'Task','1/2/2001','1/5/2001','',Null);
end;
EndUpdate();
end
|
1197
|
Is it possible to display the shadow for EBN bars
![](images/exg2anttq1197.png)
with G2antt1 do
begin
BeginUpdate();
VisualAppearance.Add(1,'c:\exontrol\images\normal.ebn');
Columns.Add('Task');
Chart.FirstVisibleDate := '1/1/2001';
Chart.PaneWidth[False] := 48;
with Chart.Bars.Copy('Task','EBN') do
begin
Color := $1000000;
Pattern := EXG2ANTTLib_TLB.exPatternFrameShadow;
end;
Chart.Bars.Copy('Task','EBN2').Color := $1000000;
with Items do
begin
AddBar(AddItem('Task 1'),'EBN2','1/2/2001','1/5/2001','',Null);
AddBar(AddItem('Task 2'),'EBN','1/2/2001','1/5/2001','',Null);
AddBar(AddItem('Task 3'),'EBN2','1/2/2001','1/5/2001','',Null);
end;
EndUpdate();
end
|
1196
|
Can I display a shadow for my bars
![](images/exg2anttq1196.png)
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Task');
Chart.FirstVisibleDate := '1/1/2001';
Chart.PaneWidth[False] := 48;
Chart.Bars.Item['Task'].Pattern := Integer(EXG2ANTTLib_TLB.exPatternFrameShadow) Or Integer(EXG2ANTTLib_TLB.exPatternShadow);
with Items do
begin
AddBar(AddItem('Task 1'),'Task','1/2/2001','1/5/2001','',Null);
AddBar(AddItem('Task 2'),'Task','1/2/2001','1/5/2001','',Null);
end;
EndUpdate();
end
|
1195
|
How can I use the Color property for gradient bars
![](images/exg2anttq1195.png)
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Task');
Chart.FirstVisibleDate := '1/1/2001';
Chart.PaneWidth[False] := 48;
with Chart.Bars.Add('V') do
begin
Color := $ff;
StartColor := $ff00;
EndColor := StartColor;
Pattern := Integer(EXG2ANTTLib_TLB.exPatternGradient3Colors) Or Integer(EXG2ANTTLib_TLB.exPatternGradientVBox) Or Integer(EXG2ANTTLib_TLB.exPatternBox);
Height := -1;
end;
with Chart.Bars.Add('H') do
begin
Color := $ff;
StartColor := $ff00;
EndColor := StartColor;
Pattern := Integer(EXG2ANTTLib_TLB.exPatternGradient3Colors) Or Integer(EXG2ANTTLib_TLB.exPatternBox);
end;
with Items do
begin
AddBar(AddItem('Task 1'),'V','1/2/2001','1/5/2001','',Null);
AddBar(AddItem('Task 2'),'H','1/2/2001','1/5/2001','',Null);
end;
EndUpdate();
end
|
1194
|
Is there any option to show bars with vertical gradient
![](images/exg2anttq1194.png)
with G2antt1 do
begin
Columns.Add('Task');
Chart.FirstVisibleDate := '1/1/2001';
with Chart.Bars.Item['Task'] do
begin
Color := $ff;
StartColor := $ff00;
EndColor := $ffff;
Pattern := Integer(EXG2ANTTLib_TLB.exPatternGradientVBox) Or Integer(EXG2ANTTLib_TLB.exPatternBox);
end;
with Items do
begin
h := AddItem('Task');
AddBar(h,'Task','1/2/2001','1/5/2001','',Null);
end;
end
|
1193
|
How can I define a new milestone bar
![](images/exg2anttq1193.png)
with G2antt1 do
begin
BeginUpdate();
Images('gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTql' +
'Vq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0' +
'ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yN' +
'AOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=');
Chart.FirstVisibleDate := '1/1/2001';
with Chart.Bars do
begin
AddShapeCorner(OleVariant(12345),OleVariant(1));
AddShapeCorner(OleVariant(12346),OleVariant(2));
Copy('Milestone','M1').StartShape := EXG2ANTTLib_TLB.ShapeCornerEnum($3020 Or Integer(EXG2ANTTLib_TLB.exShapeIconVBar) Or Integer(EXG2ANTTLib_TLB.exShapeIconRight));
Copy('Milestone','M2').StartShape := EXG2ANTTLib_TLB.ShapeCornerEnum($3020 Or Integer(EXG2ANTTLib_TLB.exShapeIconSquare) Or Integer(EXG2ANTTLib_TLB.exShapeIconRight));
with Copy('Milestone','MP') do
begin
StartShape := EXG2ANTTLib_TLB.exShapeIconStar;
StartColor := $ff;
end;
end;
Columns.Add('Column');
with Items do
begin
AddBar(AddItem('Default'),'Milestone','1/2/2001','1/2/2001',Null,Null);
AddBar(AddItem('Predefined'),'MP','1/3/2001','1/3/2001',Null,Null);
AddBar(AddItem('Custom 1'),'M1','1/4/2001','1/4/2001',Null,Null);
AddBar(AddItem('Custom 2'),'M2','1/5/2001','1/5/2001',Null,Null);
end;
EndUpdate();
end
|
1192
|
How can I define my milestone bar, using my icons or pictures
with G2antt1 do
begin
Images('gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTql' +
'Vq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0' +
'ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yN' +
'AOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=');
Chart.FirstVisibleDate := '1/1/2001';
with Chart.Bars do
begin
AddShapeCorner(OleVariant(12345),OleVariant(1));
Item['Milestone'].StartShape := EXG2ANTTLib_TLB.ShapeCornerEnum($3020 Or Integer(EXG2ANTTLib_TLB.exShapeIconVBar) Or Integer(EXG2ANTTLib_TLB.exShapeIconRight));
end;
Columns.Add('Column');
with Items do
begin
AddBar(AddItem('Item 1'),'Milestone','1/2/2001','1/2/2001',Null,Null);
end;
end
|
1191
|
Is it possible to specify manually non-working days instead using the NonworkingDays as being repetitive
![](images/exg2anttq1191.png)
with G2antt1 do
begin
BeginUpdate();
with Chart do
begin
DrawGridLines := EXG2ANTTLib_TLB.exAllLines;
FirstVisibleDate := '1/1/2010';
PaneWidth[False] := 0;
LevelCount := 2;
Level[0].DrawGridLines := True;
ShowNonworkingUnits := False;
ShowNonworkingDates := False;
NonworkingDays := 0;
AddNonworkingDate('1/10/2010');
AddNonworkingDate('1/11/2010');
AddNonworkingDate('1/15/2010');
AddNonworkingDate('1/16/2010');
end;
EndUpdate();
end
|
1190
|
Is it possible to hide specific days
![](images/exg2anttq1190.png)
with G2antt1 do
begin
BeginUpdate();
with Chart do
begin
DrawGridLines := EXG2ANTTLib_TLB.exAllLines;
FirstVisibleDate := '1/1/2010';
PaneWidth[False] := 0;
LevelCount := 2;
Level[0].DrawGridLines := True;
ShowNonworkingUnits := False;
ShowNonworkingDates := False;
NonworkingDays := 128;
AddNonworkingDate('1/10/2010');
AddNonworkingDate('1/11/2010');
AddNonworkingDate('1/15/2010');
AddNonworkingDate('1/16/2010');
end;
EndUpdate();
end
|
1189
|
Is it possible to show or display the marked zones ONLY in the overview part of the control
![](images/exg2anttq1189.png)
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Task');
with Chart do
begin
LevelCount := 2;
FirstVisibleDate := '1/14/2001';
PaneWidth[False] := 48;
AllowLinkBars := False;
AllowCreateBar := EXG2ANTTLib_TLB.exNoCreateBar;
OverviewVisible := EXG2ANTTLib_TLB.exOverviewShowAllVisible;
Bars.Item['Task'].Pattern := EXG2ANTTLib_TLB.exPatternSolid;
MarkTimeZone('Z1','1/3/2001','1/4/2001',OleVariant(BackColor),';;Zone <b>1</b>');
MarkTimeZone('Z2','2/6/2001','2/7/2001',OleVariant(BackColor),';;Zone <b>2</b>');
MarkTimeZone('Z3','1/16/2001','1/19/2001',OleVariant(BackColor),';;Zone <b>3</b>');
OverviewShowMarkTimeZones := True;
OverviewBackColor := $f0f0dc;
end;
with Items do
begin
h1 := AddItem('Task 1');
AddBar(h1,'Task','1/2/2001','1/5/2001','K1',Null);
h2 := AddItem('Task 2');
AddBar(h2,'Task','2/5/2001','2/8/2001','K2',Null);
AddLink('L1',h1,'K1',h2,'K2');
end;
EndUpdate();
end
|
1188
|
Is it possible to show or display the marked zones in the overview part of the control
![](images/exg2anttq1188.png)
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Task');
with Chart do
begin
LevelCount := 2;
FirstVisibleDate := '1/14/2001';
PaneWidth[False] := 48;
AllowLinkBars := False;
AllowCreateBar := EXG2ANTTLib_TLB.exNoCreateBar;
OverviewVisible := EXG2ANTTLib_TLB.exOverviewShowAllVisible;
Bars.Item['Task'].Pattern := EXG2ANTTLib_TLB.exPatternSolid;
MarkTimeZone('Z1','1/3/2001','1/4/2001',OleVariant(16777056),Null);
MarkTimeZone('Z2','2/6/2001','2/7/2001',OleVariant(16744544),Null);
MarkTimeZone('Z3','1/16/2001','1/19/2001',OleVariant(16744544),Null);
OverviewShowMarkTimeZones := True;
end;
with Items do
begin
h1 := AddItem('Task 1');
AddBar(h1,'Task','1/2/2001','1/5/2001','K1',Null);
h2 := AddItem('Task 2');
AddBar(h2,'Task','2/5/2001','2/8/2001','K2',Null);
AddLink('L1',h1,'K1',h2,'K2');
end;
EndUpdate();
end
|
1187
|
Is there a quick way to determine if a bar belongs to a group
with G2antt1 do
begin
Columns.Add('Task');
with Chart do
begin
FirstVisibleDate := '1/1/2001';
PaneWidth[False] := 64;
end;
with Items do
begin
h1 := AddItem('Task 1');
AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null);
h2 := AddItem('Task 2');
AddBar(h2,'Task','1/5/2001','1/7/2001','K2',Null);
h3 := AddItem('Task 3');
AddBar(h3,'Task','1/5/2001','1/7/2001','K3',Null);
GroupBars(h1,'K1',True,h2,'K2',True,Null,Null);
GroupBars(h1,'K1',False,h2,'K2',False,Null,Null);
GroupBars(h1,'K1',True,h3,'K3',True,Null,Null);
GroupBars(h1,'K1',False,h3,'K3',False,Null,Null);
OutputDebugString( ItemBar[h1,'K1',EXG2ANTTLib_TLB.exBarsGroup] );
end;
end
|
1186
|
I am using the ScrollRange property to limit the chart's visible area, but it does not work as expected. What could be wrong
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Task');
with Chart do
begin
LevelCount := 2;
PaneWidth[False] := 56;
ScrollRange[EXG2ANTTLib_TLB.exStartDate] := '1/1/100';
ScrollRange[EXG2ANTTLib_TLB.exEndDate] := '12/31/9999';
FirstVisibleDate := '4/28/2010';
end;
ScrollPartCaption[EXG2ANTTLib_TLB.exHChartScroll,EXG2ANTTLib_TLB.exLowerBackPart] := Chart.ScrollRange[EXG2ANTTLib_TLB.exStartDate];
ScrollPartCaptionAlignment[EXG2ANTTLib_TLB.exHChartScroll,EXG2ANTTLib_TLB.exLowerBackPart] := EXG2ANTTLib_TLB.LeftAlignment;
ScrollPartCaption[EXG2ANTTLib_TLB.exHChartScroll,EXG2ANTTLib_TLB.exUpperBackPart] := Chart.ScrollRange[EXG2ANTTLib_TLB.exEndDate];
ScrollPartCaptionAlignment[EXG2ANTTLib_TLB.exHChartScroll,EXG2ANTTLib_TLB.exUpperBackPart] := EXG2ANTTLib_TLB.RightAlignment;
EndUpdate();
end
|
1185
|
Are you planning to add a AddNonworkingDate / AddNonworkingDay for separate items
![](images/exg2anttq1185.png)
with G2antt1 do
begin
BeginUpdate();
AllowChartScrollPage := True;
Columns.Add('Non-Work');
with Chart do
begin
FirstVisibleDate := '4/4/2009';
PaneWidth[False] := 52;
LevelCount := 2;
end;
with Items do
begin
AddItem('Default');
ItemNonworkingUnits[AddItem('Test 1'),OleVariant(False)] := 'shortdate(value) in (#4/5/2009#,#4/6/2009#)';
ItemNonworkingUnits[AddItem('Test 2'),OleVariant(False)] := 'shortdate(value) in (#4/6/2009#,#4/7/2009#)';
ItemNonworkingUnits[AddItem('Test 3'),OleVariant(False)] := 'shortdate(value) in (#4/7/2009#,#4/9/2009#)';
AddItem('Default');
end;
EndUpdate();
end
|
1184
|
How can I enlarge the EBN being applied to an object
![](images/exg2anttq1184.png)
with G2antt1 do
begin
BeginUpdate();
DefaultItemHeight := 32;
with VisualAppearance do
begin
Add(2,'c:\exontrol\images\normal.ebn');
Add(1,'CP:2 -3 -2 3 2');
end;
with Chart do
begin
FirstVisibleDate := '1/1/2002';
SelBarColor := $1000000;
PaneWidth[False] := 48;
end;
Columns.Add('Task');
with Items do
begin
h := AddItem('Task 1');
AddBar(h,'Task','1/2/2002','1/4/2002','A',Null);
AddBar(h,'Task','1/6/2002','1/10/2002','B',Null);
AddBar(h,'Task','1/11/2002','1/14/2002','C',Null);
ItemBar[h,'A',EXG2ANTTLib_TLB.exBarSelected] := OleVariant(True);
ItemBar[h,'B',EXG2ANTTLib_TLB.exBarSelected] := OleVariant(True);
end;
EndUpdate();
end
|
1183
|
I am using EBN to display my bars but the bars shows in black in the overview area. Is there any option to specify a different color in the overview part of the control
![](images/exg2anttq1183.png)
with G2antt1 do
begin
BeginUpdate();
VisualAppearance.Add(1,'c:\exontrol\images\normal.ebn');
with Chart do
begin
Bars.Item['Task'].Color := $1000000;
PaneWidth[False] := 48;
OverviewVisible := EXG2ANTTLib_TLB.exOverviewShowAllVisible;
FirstVisibleDate := '1/11/2001';
LevelCount := 2;
end;
Columns.Add('Column');
with Items do
begin
h := AddItem('Task 1');
AddBar(h,'Task','1/2/2001','1/4/2001',OleVariant(1),Null);
ItemBar[h,OleVariant(1),EXG2ANTTLib_TLB.exBarOverviewColor] := OleVariant(8821418);
AddBar(h,'Task','2/2/2001','2/4/2001',OleVariant(2),Null);
ItemBar[h,OleVariant(2),EXG2ANTTLib_TLB.exBarOverviewColor] := OleVariant(8821418);
h := AddItem('Task 2');
AddBar(h,'Task','2/2/2001','2/4/2001','',Null);
ItemBar[h,'',EXG2ANTTLib_TLB.exBarOverviewColor] := OleVariant(8821418);
end;
EndUpdate();
end
|
1182
|
I haven't found options to localize (in Italian) the strings ( dates, tooltip ) that shows in the chart area
![](images/exg2anttq1182.png)
with G2antt1 do
begin
BeginUpdate();
with Chart do
begin
LevelCount := 2;
PaneWidth[False] := 0;
Label[EXG2ANTTLib_TLB.exWeek] := '<|><%ww%><|><%d%> <%m3%> ''<%yy%><r><%ww%><|><%d%> <%mmmm%> <%yyyy%><r><%ww%><||><||>256';
Label[EXG2ANTTLib_TLB.exDay] := '<|><%d1%><|><%d2%><|><%d3%><|><%dddd%><|><%d3%> <%d%> <%m3%> ''<%yy%><|><%dddd%> <%d%> <%mmmm%> <%yyyy%><||><||>4096';
LabelToolTip[EXG2ANTTLib_TLB.exWeek] := '<%d%> <%mmmm%> <%yyyy%> <%ww%>';
LabelToolTip[EXG2ANTTLib_TLB.exDay] := '<%dddd%> <%d%> <%mmmm%> <%yyyy%>';
FirstWeekDay := EXG2ANTTLib_TLB.exMonday;
MonthNames := 'gennaio febbraio marzo aprile maggio giugno luglio agosto settembre ottobre novembre dicembre';
WeekDays := 'domenica lunedì martedì mercoledì giovedì venerdì sabato';
ToolTip := '<%dddd%> <%d%> <%mmmm%> <%yyyy%>';
UnitScale := EXG2ANTTLib_TLB.exDay;
end;
EndUpdate();
end
|
1181
|
I haven't found options to localize (in Dutch) the strings ( dates, tooltip ) that shows in the chart area
![](images/exg2anttq1181.png)
with G2antt1 do
begin
BeginUpdate();
with Chart do
begin
LevelCount := 2;
PaneWidth[False] := 0;
Label[EXG2ANTTLib_TLB.exWeek] := '<|><%ww%><|><%d%> <%m3%> ''<%yy%><r><%ww%><|><%d%> <%mmmm%> <%yyyy%><r><%ww%><||><||>256';
Label[EXG2ANTTLib_TLB.exDay] := '<|><%d1%><|><%d2%><|><%d3%><|><%dddd%><|><%d3%> <%d%> <%m3%> ''<%yy%><|><%dddd%> <%d%> <%mmmm%> <%yyyy%><||><||>4096';
LabelToolTip[EXG2ANTTLib_TLB.exWeek] := '<%d%> <%mmmm%> <%yyyy%> <%ww%>';
LabelToolTip[EXG2ANTTLib_TLB.exDay] := '<%dddd%> <%d%> <%mmmm%> <%yyyy%>';
FirstWeekDay := EXG2ANTTLib_TLB.exMonday;
MonthNames := 'januari februari maart april mei juni juli augusts september oktober november december';
WeekDays := 'zondag maandag dinsdag woensdag donderdag vrijdag zaterdag';
ToolTip := '<%dddd%> <%d%> <%mmmm%> <%yyyy%>';
UnitScale := EXG2ANTTLib_TLB.exDay;
end;
EndUpdate();
end
|
1180
|
I haven't found options to localize (in German) the strings ( dates, tooltip ) that shows in the chart area (method 1)
![](images/exg2anttq1180.png)
with G2antt1 do
begin
BeginUpdate();
with Chart do
begin
LevelCount := 2;
PaneWidth[False] := 0;
Label[EXG2ANTTLib_TLB.exWeek] := '<|><%ww%><|><%d%> <%m3%> ''<%yy%><r><%ww%><|><%d%>.<%mmmm%> <%yyyy%><r><%ww%><||><||>256';
Label[EXG2ANTTLib_TLB.exDay] := '<|><%d1%><|><%d2%><|><%d3%><|><%dddd%><|><%d3%> <%d%>.<%m3%> ''<%yy%><|><%dddd%> <%d%>.<%mmmm%> <%yyyy%><||><||>4096';
LabelToolTip[EXG2ANTTLib_TLB.exWeek] := '<%d%>.<%mmmm%> <%yyyy%> <%ww%>';
LabelToolTip[EXG2ANTTLib_TLB.exDay] := '<%dddd%>, <%d%>.<%mmmm%> <%yyyy%>';
FirstWeekDay := EXG2ANTTLib_TLB.exMonday;
MonthNames := 'Januar Februar März April Mai Juni Juli August September Oktober November Dezember';
WeekDays := 'Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag';
ToolTip := '<%dddd%>,<%d%>.<%mmmm%> <%yyyy%>';
UnitScale := EXG2ANTTLib_TLB.exDay;
end;
EndUpdate();
end
|
1179
|
I haven't found options to localize (in French) the strings ( dates, tooltip ) that shows in the chart area
![](images/exg2anttq1179.png)
with G2antt1 do
begin
BeginUpdate();
with Chart do
begin
LevelCount := 2;
PaneWidth[False] := 0;
Label[EXG2ANTTLib_TLB.exWeek] := '<|><%ww%><|><%d%> <%m3%> ''<%yy%><r><%ww%><|><%d%> <%mmmm%> <%yyyy%><r><%ww%><||><||>256';
Label[EXG2ANTTLib_TLB.exDay] := '<|><%d1%><|><%d2%><|><%d3%><|><%dddd%><|><%d3%> <%d%> <%m3%> ''<%yy%><|><%dddd%> <%d%> <%mmmm%> <%yyyy%><||><||>4096';
LabelToolTip[EXG2ANTTLib_TLB.exWeek] := '<%d%> <%mmmm%> <%yyyy%> <%ww%>';
LabelToolTip[EXG2ANTTLib_TLB.exDay] := '<%dddd%> <%d%> <%mmmm%> <%yyyy%>';
FirstWeekDay := EXG2ANTTLib_TLB.exMonday;
MonthNames := 'janvier février mars avril mai juin juillet août septembre octobre novembre décembre';
WeekDays := 'dimanche lundi mardi mercredi jeudi vendredi samedi';
ToolTip := '<%dddd%> <%d%> <%mmmm%> <%yyyy%>';
UnitScale := EXG2ANTTLib_TLB.exDay;
end;
EndUpdate();
end
|
1178
|
How can I determine the last visible date in the chart
// MouseMove event - Occurs when the user moves the mouse.
procedure TForm1.G2antt1MouseMove(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer);
begin
with G2antt1 do
begin
OutputDebugString( 'First' );
OutputDebugString( Chart.FirstVisibleDate );
OutputDebugString( 'Last' );
OutputDebugString( Chart.DateFromPoint[1,-1] );
end
end;
with G2antt1 do
begin
BeginUpdate();
with Chart do
begin
LevelCount := 2;
PaneWidth[False] := 1;
end;
EndUpdate();
end
|
1177
|
How can I filter programatically using more columns
with G2antt1 do
begin
BeginUpdate();
Chart.PaneWidth[True] := 0;
MarkSearchColumn := False;
with Columns do
begin
Add('Car');
Add('Equipment');
end;
with Items do
begin
CellValue[OleVariant(AddItem('Mazda')),OleVariant(1)] := 'Air Bag';
CellValue[OleVariant(AddItem('Toyota')),OleVariant(1)] := 'Air Bag,Air condition';
CellValue[OleVariant(AddItem('Ford')),OleVariant(1)] := 'Air condition';
CellValue[OleVariant(AddItem('Nissan')),OleVariant(1)] := 'Air Bag,ABS,ESP';
CellValue[OleVariant(AddItem('Mazda')),OleVariant(1)] := 'Air Bag, ABS,ESP';
CellValue[OleVariant(AddItem('Mazda')),OleVariant(1)] := 'ABS,ESP';
end;
with Columns.Item['Car'] do
begin
FilterType := EXG2ANTTLib_TLB.exFilter;
Filter := 'Mazda';
end;
with Columns.Item['Equipment'] do
begin
FilterType := EXG2ANTTLib_TLB.exPattern;
Filter := '*ABS*|*ESP*';
end;
ApplyFilter();
EndUpdate();
end
|
1176
|
Do you have scheduling functionality in Gantt (meaning scheduling several activities (bars) depending on their start and finish dates with considering dependencies to other activities
// BarResize event - Occurs when a bar is moved or resized.
procedure TForm1.G2antt1BarResize(ASender: TObject; Item : HITEM;Key : OleVariant);
begin
with G2antt1 do
begin
Items.SchedulePDM(Item,OleVariant(Key));
end
end;
with G2antt1 do
begin
BeginUpdate();
Items.AllowCellValueToItemBar := True;
Columns.Add('Task');
(IUnknown(Columns.Add('Working')) as EXG2ANTTLib_TLB.Column).Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(258);
with Chart do
begin
Bars.Add('Task:Split').Shortcut := 'Task';
FirstVisibleDate := '12/28/2000';
PaneWidth[False] := 96;
AllowLinkBars := False;
AllowCreateBar := EXG2ANTTLib_TLB.exNoCreateBar;
end;
with Items do
begin
h1 := AddItem('Task 1');
AddBar(h1,'Task','1/2/2001','1/4/2001','',Null);
h2 := AddItem('Task 2');
AddBar(h2,'Task','1/2/2001','1/4/2001','',Null);
AddLink('L1',h1,'',h2,'');
h3 := AddItem('Task 3');
AddBar(h3,'Task','1/2/2001','1/6/2001','',Null);
AddLink('L2',h2,'',h3,'');
Link['L2',EXG2ANTTLib_TLB.exLinkText] := 'FF';
Link['L2',EXG2ANTTLib_TLB.exLinkStartPos] := OleVariant(2);
Link['L2',EXG2ANTTLib_TLB.exLinkEndPos] := OleVariant(2);
h4 := AddItem('Task 4');
AddBar(h4,'Task','1/2/2001','1/4/2001','',Null);
AddLink('L3',h4,'',h3,'');
ItemBar[0,'<*>',EXG2ANTTLib_TLB.exBarKeepWorkingCount] := OleVariant(True);
SchedulePDM(FirstVisibleItem,'');
end;
EndUpdate();
end
|
1175
|
How can I show the ticks for a single slider field
with G2antt1 do
begin
BeginUpdate();
(IUnknown(Columns.Add('Slider')) as EXG2ANTTLib_TLB.Column).Editor.EditType := EXG2ANTTLib_TLB.SliderType;
with Items do
begin
AddItem(OleVariant(10));
with CellEditor[OleVariant(AddItem(OleVariant(20))),OleVariant(0)] do
begin
EditType := EXG2ANTTLib_TLB.SliderType;
Option[EXG2ANTTLib_TLB.exSliderTickFrequency] := OleVariant(10);
end;
AddItem(OleVariant(30));
end;
EndUpdate();
end
|
1174
|
Is it possible to show ticks for slider fields
with G2antt1 do
begin
with (IUnknown(Columns.Add('Slider')) as EXG2ANTTLib_TLB.Column).Editor do
begin
EditType := EXG2ANTTLib_TLB.SliderType;
Option[EXG2ANTTLib_TLB.exSliderTickFrequency] := OleVariant(10);
end;
Items.AddItem(OleVariant(10));
end
|
1173
|
How can I group two bars so the distance between them is limited to a specified range
![](images/exg2anttq1173.png)
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Tasks');
with Chart do
begin
FirstVisibleDate := '9/20/2006';
PaneWidth[False] := 48;
LevelCount := 2;
end;
with Items do
begin
h1 := AddItem('Task 1');
AddBar(h1,'Task','9/21/2006','9/24/2006',Null,Null);
h2 := AddItem('Task 2');
AddBar(h2,'Unknown','9/25/2006','9/28/2006',Null,Null);
AddLink('L1',h1,'',h2,'');
GroupBars(h1,'',False,h2,'',True,OleVariant(31),'1;2');
OutputDebugString( 'The distance between A and B is limited between 1 and 3 days' );
OutputDebugString( 'The B is always after the A' );
end;
EndUpdate();
end
|
1172
|
How can I group two bars so the distance between them is flexible but never less than a specified value
![](images/exg2anttq1172.png)
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Tasks');
with Chart do
begin
FirstVisibleDate := '9/20/2006';
PaneWidth[False] := 48;
LevelCount := 2;
end;
with Items do
begin
h1 := AddItem('Task 1');
AddBar(h1,'Task','9/21/2006','9/24/2006',Null,Null);
h2 := AddItem('Task 2');
AddBar(h2,'Unknown','9/26/2006','9/29/2006',Null,Null);
AddLink('L1',h1,'',h2,'');
GroupBars(h1,'',False,h2,'',True,OleVariant(39),'2');
OutputDebugString( 'The distance between A and B is never less than 2 days' );
OutputDebugString( 'The B is always after the A' );
end;
EndUpdate();
end
|
1171
|
How can I group two bars so the distance between them is flexible
![](images/exg2anttq1171.png)
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Tasks');
with Chart do
begin
FirstVisibleDate := '9/20/2006';
PaneWidth[False] := 48;
LevelCount := 2;
end;
with Items do
begin
h1 := AddItem('Task 1');
AddBar(h1,'Task','9/21/2006','9/24/2006',Null,Null);
h2 := AddItem('Task 2');
AddBar(h2,'Unknown','9/26/2006','9/29/2006',Null,Null);
AddLink('L1',h1,'',h2,'');
GroupBars(h1,'',False,h2,'',True,OleVariant(39),Null);
OutputDebugString( 'The distance between A and B is flexible, unlimited' );
OutputDebugString( 'The B is always after the A' );
end;
EndUpdate();
end
|
1170
|
How can I group two bars so the interval between them is fixed
![](images/exg2anttq1170.png)
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Tasks');
with Chart do
begin
FirstVisibleDate := '9/20/2006';
PaneWidth[False] := 48;
LevelCount := 2;
end;
with Items do
begin
h := AddItem('Task 1');
AddBar(h,'Task','9/21/2006','9/24/2006','T1','A');
AddBar(h,'Unknown','9/26/2006','9/29/2006','T2','B');
AddLink('L',h,'T1',h,'T2');
Link['L',EXG2ANTTLib_TLB.exLinkGroupBars] := OleVariant(27);
Link['L',EXG2ANTTLib_TLB.exLinkShowDir] := OleVariant(False);
h2 := AddItem('Task 2');
AddBar(h2,'Unknown','9/26/2006','9/29/2006','T2','B');
AddLink('L2',h,'T1',h2,'T2');
Link['L2',EXG2ANTTLib_TLB.exLinkGroupBars] := OleVariant(27);
Link['L2',EXG2ANTTLib_TLB.exLinkShowDir] := OleVariant(False);
OutputDebugString( 'The distance between bars is constant' );
OutputDebugString( 'The B is always after the A' );
end;
EndUpdate();
end
|
1169
|
How can I group two bars when linking, so moving the first bar will makes the second to move accordingly
![](images/exg2anttq1169.png)
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Tasks');
with Chart do
begin
FirstVisibleDate := '9/20/2006';
PaneWidth[False] := 48;
LevelCount := 2;
end;
with Items do
begin
h1 := AddItem('Task 1');
AddBar(h1,'Task','9/21/2006','9/24/2006','','A');
h2 := AddItem('Task 2');
AddBar(h2,'Unknown','9/26/2006','9/29/2006','','B');
AddLink('L1',h1,'',h2,'');
Link['L1',EXG2ANTTLib_TLB.exLinkGroupBars] := OleVariant(39);
OutputDebugString( 'The distance between A and B is flexible, unlimited' );
OutputDebugString( 'The B is always after the A' );
end;
EndUpdate();
end
|
1168
|
Is it possible to be notified when the user clicks an anchor element a hyperlink in the date-time zone
![](images/exg2anttq1168.png)
// AnchorClick event - Occurs when an anchor element is clicked.
procedure TForm1.G2antt1AnchorClick(ASender: TObject; AnchorID : WideString;Options : WideString);
begin
with G2antt1 do
begin
OutputDebugString( 'Click: ' );
OutputDebugString( AnchorID );
end
end;
with G2antt1 do
begin
BeginUpdate();
with Chart do
begin
FirstVisibleDate := '12/28/2000';
PaneWidth[False] := 48;
MarkTimeZone('Z','1/2/2001','1/5/2001',OleVariant(15753471),';32;Caption <a1><b>1</b></a>;1;Caption <a2><b>2</b></a>;17;Caption <a3><b>3</b></a>');
end;
EndUpdate();
end
|
1167
|
Is it possible to be notified when the user clicks a date-time zone
![](images/exg2anttq1167.png)
// Click event - Occurs when the user presses and then releases the left mouse button over the tree control.
procedure TForm1.G2antt1Click(ASender: TObject; );
begin
with G2antt1 do
begin
with Chart do
begin
OutputDebugString( 'Click: ' );
OutputDebugString( TimeZoneFromPoint[-1,-1] );
end;
end
end;
with G2antt1 do
begin
BeginUpdate();
with Chart do
begin
FirstVisibleDate := '12/28/2000';
PaneWidth[False] := 48;
MarkTimeZone('Z','1/2/2001','1/5/2001',OleVariant(16711680),';32;DATE-TIME<br> ZONE');
end;
EndUpdate();
end
|
1166
|
Is is possible to display multiple captions in the same date-time zone
![](images/exg2anttq1166.png)
with G2antt1 do
begin
BeginUpdate();
with Chart do
begin
FirstVisibleDate := '12/28/2000';
PaneWidth[False] := 48;
MarkTimeZone('Z','1/5/2001','1/8/2001',OleVariant(12895487),';;Caption <b>1</b>;1;Caption <b>2</b>;17;Caption <b>3</b>');
end;
EndUpdate();
end
|
1165
|
Is is possible to align on the top the caption for the date-time zone
![](images/exg2anttq1165.png)
with G2antt1 do
begin
BeginUpdate();
with Chart do
begin
FirstVisibleDate := '12/28/2000';
PaneWidth[False] := 48;
MarkTimeZone('Z','1/5/2001','1/8/2001',OleVariant(12895487),';;UpperCenter;1');
end;
EndUpdate();
end
|
1164
|
Is there any option to display a picture on the date-time zone
![](images/exg2anttq1164.png)
with G2antt1 do
begin
BeginUpdate();
HTMLPicture['pic1'] := 'c:\exontrol\images\card.png';
with Chart do
begin
FirstVisibleDate := '12/28/2000';
PaneWidth[False] := 48;
MarkTimeZone('Z','1/5/2001','1/8/2001',OleVariant(12895487),';;<c><img>pic1</img><br><c>picture');
end;
EndUpdate();
end
|
1163
|
Is there any option to display a text or a HTML caption on the date-time zone
![](images/exg2anttq1163.png)
with G2antt1 do
begin
BeginUpdate();
with Chart do
begin
FirstVisibleDate := '12/28/2000';
PaneWidth[False] := 48;
MarkTimeZone('Z1','1/1/2001','1/4/2001',OleVariant(12895487),';;zone <b>1</b>');
MarkTimeZone('Z2','1/5/2001','1/8/2001',OleVariant(12895487),';;zone <b>2</b>');
end;
EndUpdate();
end
|
1162
|
How can I display the date-time zone using a semi-transparent EBN object
![](images/exg2anttq1162.png)
with G2antt1 do
begin
BeginUpdate();
VisualAppearance.Add(1,'c:\exontrol\images\normal.ebn');
Columns.Add('Task');
with Chart do
begin
FirstVisibleDate := '12/28/2000';
PaneWidth[False] := 48;
AllowLinkBars := False;
AllowCreateBar := EXG2ANTTLib_TLB.exNoCreateBar;
Bars.Item['Task'].Pattern := EXG2ANTTLib_TLB.exPatternSolid;
MarkTimeZone('Z1','1/2/2001','1/3/2001',OleVariant(16777056),';;Solid');
MarkTimeZone('Z2','1/7/2001','1/10/2001',OleVariant(16777216),'50;;EBN');
end;
with Items do
begin
h1 := AddItem('Task 1');
AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null);
h2 := AddItem('Task 2');
AddBar(h2,'Task','1/5/2001','1/8/2001','K2',Null);
AddLink('L1',h1,'K1',h2,'K2');
end;
EndUpdate();
end
|
1161
|
How can I display the date-time zone using an EBN or a skin instead a solid color
![](images/exg2anttq1161.png)
with G2antt1 do
begin
BeginUpdate();
VisualAppearance.Add(1,'c:\exontrol\images\normal.ebn');
Columns.Add('Task');
with Chart do
begin
FirstVisibleDate := '12/28/2000';
PaneWidth[False] := 48;
AllowLinkBars := False;
AllowCreateBar := EXG2ANTTLib_TLB.exNoCreateBar;
Bars.Item['Task'].Pattern := EXG2ANTTLib_TLB.exPatternSolid;
MarkTimeZone('Z1','1/2/2001','1/3/2001',OleVariant(16777056),';;Solid');
MarkTimeZone('Z2','1/5/2001','1/8/2001',OleVariant(16777216),';;EBN');
end;
with Items do
begin
h1 := AddItem('Task 1');
AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null);
h2 := AddItem('Task 2');
AddBar(h2,'Task','1/5/2001','1/8/2001','K2',Null);
AddLink('L1',h1,'K1',h2,'K2');
end;
EndUpdate();
end
|
1160
|
How can I display the date-time zone using a pattern instead a solid color
![](images/exg2anttq1160.png)
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Task');
with Chart do
begin
FirstVisibleDate := '12/28/2000';
PaneWidth[False] := 48;
AllowLinkBars := False;
AllowCreateBar := EXG2ANTTLib_TLB.exNoCreateBar;
Bars.Item['Task'].Pattern := EXG2ANTTLib_TLB.exPatternSolid;
MarkTimeZone('Z1','1/2/2001','1/3/2001',OleVariant(16777056),';;Solid');
MarkTimeZone('Z2','1/6/2001','1/7/2001',OleVariant(16777056),';12;Pattern');
end;
with Items do
begin
h1 := AddItem('Task 1');
AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null);
h2 := AddItem('Task 2');
AddBar(h2,'Task','1/5/2001','1/8/2001','K2',Null);
AddLink('L1',h1,'K1',h2,'K2');
end;
EndUpdate();
end
|
1159
|
How can I display the date-time zone using a transparent color
![](images/exg2anttq1159.png)
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Task');
with Chart do
begin
FirstVisibleDate := '12/28/2000';
PaneWidth[False] := 48;
AllowLinkBars := False;
AllowCreateBar := EXG2ANTTLib_TLB.exNoCreateBar;
Bars.Item['Task'].Pattern := EXG2ANTTLib_TLB.exPatternSolid;
MarkTimeZone('Z1','1/2/2001','1/3/2001',OleVariant(16777056),';;Opaque');
MarkTimeZone('Z2','1/6/2001','1/7/2001',OleVariant(16777056),'50;;Semi-Transparent');
end;
with Items do
begin
h1 := AddItem('Task 1');
AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null);
h2 := AddItem('Task 2');
AddBar(h2,'Task','1/5/2001','1/8/2001','K2',Null);
AddLink('L1',h1,'K1',h2,'K2');
end;
EndUpdate();
end
|
1158
|
The date time zone is shown behind the bars, is there any way to show it over
![](images/exg2anttq1158.png)
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Task');
with Chart do
begin
FirstVisibleDate := '12/28/2000';
PaneWidth[False] := 48;
AllowLinkBars := False;
AllowCreateBar := EXG2ANTTLib_TLB.exNoCreateBar;
Bars.Item['Task'].Pattern := EXG2ANTTLib_TLB.exPatternSolid;
MarkTimeZone('Z1','1/2/2001','1/3/2001',OleVariant(16777056),Null);
MarkTimeZone('Z2','1/6/2001','1/7/2001',OleVariant(16777056),'1');
end;
with Items do
begin
h1 := AddItem('Task 1');
AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null);
h2 := AddItem('Task 2');
AddBar(h2,'Task','1/5/2001','1/8/2001','K2',Null);
AddLink('L1',h1,'K1',h2,'K2');
end;
EndUpdate();
end
|
1157
|
How can I get ifnromation about a date-time zone
// MouseMove event - Occurs when the user moves the mouse.
procedure TForm1.G2antt1MouseMove(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer);
begin
with G2antt1 do
begin
with Chart do
begin
OutputDebugString( TimeZoneInfo[TimeZoneFromPoint[-1,-1]] );
end;
end
end;
with G2antt1 do
begin
with Chart do
begin
PaneWidth[False] := 18;
LevelCount := 2;
FirstVisibleDate := '1/1/2010';
MarkTimeZone('Z1','1/4/2010','1/8/2010',OleVariant(16744544),Null);
MarkTimeZone('Z2','1/12/2010','1/18/2010',OleVariant(16761952),Null);
end;
end
|
1156
|
How can I determine the zone from the cursor
// MouseMove event - Occurs when the user moves the mouse.
procedure TForm1.G2antt1MouseMove(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer);
begin
with G2antt1 do
begin
with Chart do
begin
OutputDebugString( TimeZoneFromPoint[-1,-1] );
end;
end
end;
with G2antt1 do
begin
with Chart do
begin
PaneWidth[False] := 18;
LevelCount := 2;
FirstVisibleDate := '1/1/2010';
MarkTimeZone('Z1','1/4/2010','1/8/2010',OleVariant(16744544),Null);
MarkTimeZone('Z2','1/12/2010','1/18/2010',OleVariant(16761952),Null);
end;
end
|
1155
|
How can I highlight multiple date-time zones (ranges)
![](images/exg2anttq1155.png)
with G2antt1 do
begin
with Chart do
begin
PaneWidth[False] := 18;
LevelCount := 2;
FirstVisibleDate := '1/1/2010';
MarkTimeZone('Z1','1/4/2010','1/8/2010',OleVariant(16744544),Null);
MarkTimeZone('Z2','1/12/2010','1/18/2010',OleVariant(16761952),Null);
end;
end
|
1154
|
How can I highlight a date-time range
with G2antt1 do
begin
with Chart do
begin
PaneWidth[False] := 18;
LevelCount := 2;
FirstVisibleDate := '1/1/2010';
MarkTimeZone('Z1','1/4/2010','1/8/2010',OleVariant(16744544),Null);
end;
end
|
1153
|
How do I get the list of selected date
// ChartEndChanging event - Occurs after the chart has been changed.
procedure TForm1.G2antt1ChartEndChanging(ASender: TObject; Operation : BarOperationEnum);
begin
with G2antt1 do
begin
OutputDebugString( Operation );
OutputDebugString( Chart.SelectDates );
end
end;
with G2antt1 do
begin
with Chart do
begin
LevelCount := 2;
PaneWidth[False] := 0;
MarkTodayColor := BackColor;
end;
end
|
1152
|
Is there any function I can use to find the bars that intersect with the current bar
![](images/exg2anttq1152.png)
// BarResizing event - Occurs when a bar is moving or resizing.
procedure TForm1.G2antt1BarResizing(ASender: TObject; Item : HITEM;Key : OleVariant);
begin
with G2antt1 do
begin
with Items do
begin
OutputDebugString( Key );
OutputDebugString( 'intesect with' );
OutputDebugString( ItemBar[Item,OleVariant(Key),EXG2ANTTLib_TLB.exBarIntersectWithAsString] );
end;
end
end;
with G2antt1 do
begin
BeginUpdate();
DefaultItemHeight := 22;
Columns.Add('Task');
ScrollBySingleLine := True;
DrawGridLines := EXG2ANTTLib_TLB.exAllLines;
with Chart do
begin
DrawGridLines := EXG2ANTTLib_TLB.exAllLines;
PaneWidth[False] := 48;
FirstVisibleDate := '12/28/2000';
LevelCount := 2;
Bars.Item['Task'].OverlaidType := EXG2ANTTLib_TLB.exOverlaidBarsOffset;
ResizeUnitScale := EXG2ANTTLib_TLB.exHour;
AllowCreateBar := EXG2ANTTLib_TLB.exCreateBarAuto;
end;
with Items do
begin
h1 := AddItem('Default');
AddBar(h1,'Task','1/2/2001','1/4/2001','A1','A1');
AddBar(h1,'Task','1/3/2001','1/5/2001','A2','A2');
AddBar(h1,'Task','1/4/2001','1/7/2001','A3','A3');
end;
EndUpdate();
end
|
1151
|
Is it possible to order the bars on top of other bars
![](images/exg2anttq1151.png)
with G2antt1 do
begin
BeginUpdate();
DefaultItemHeight := 22;
Columns.Add('Task');
ScrollBySingleLine := True;
DrawGridLines := EXG2ANTTLib_TLB.exAllLines;
with Chart do
begin
DrawGridLines := EXG2ANTTLib_TLB.exAllLines;
PaneWidth[False] := 48;
FirstVisibleDate := '12/28/2000';
LevelCount := 2;
Bars.Copy('Task','NTask').OverlaidType := EXG2ANTTLib_TLB.exOverlaidBarsOffset;
end;
with Items do
begin
h1 := AddItem('Default');
AddBar(h1,'Task','1/2/2001','1/4/2001','A1',Null);
AddBar(h1,'Task','1/3/2001','1/5/2001','A2',Null);
AddBar(h1,'Task','1/4/2001','1/7/2001','A3',Null);
h2 := AddItem('Overlaid');
AddBar(h2,'NTask','1/2/2001','1/4/2001','A1',Null);
AddBar(h2,'NTask','1/3/2001','1/5/2001','A2',Null);
AddBar(h2,'NTask','1/4/2001','1/7/2001','A3',Null);
GroupBars(h1,'A1',True,h2,'A1',True,Null,Null);
GroupBars(h1,'A1',False,h2,'A1',False,Null,Null);
GroupBars(h1,'A2',True,h2,'A2',True,Null,Null);
GroupBars(h1,'A2',False,h2,'A2',False,Null,Null);
GroupBars(h1,'A3',True,h2,'A3',True,Null,Null);
GroupBars(h1,'A3',False,h2,'A3',False,Null,Null);
end;
EndUpdate();
end
|
1150
|
Is it possible to order the bars on top of other bars (have different colurs so that they can be seen)
![](images/exg2anttq1150.png)
with G2antt1 do
begin
BeginUpdate();
DefaultItemHeight := 22;
Columns.Add('Task');
ScrollBySingleLine := True;
DrawGridLines := EXG2ANTTLib_TLB.exAllLines;
with Chart do
begin
DrawGridLines := EXG2ANTTLib_TLB.exAllLines;
PaneWidth[False] := 48;
FirstVisibleDate := '12/28/2000';
LevelCount := 2;
Bars.Copy('Task','NTask').OverlaidType := Integer(EXG2ANTTLib_TLB.exOverlaidBarsStackAutoArrange) Or Integer(EXG2ANTTLib_TLB.exOverlaidBarsStack);
end;
with Items do
begin
h1 := AddItem('Default');
AddBar(h1,'Task','1/2/2001','1/4/2001','A1',Null);
AddBar(h1,'Task','1/3/2001','1/5/2001','A2',Null);
AddBar(h1,'Task','1/4/2001','1/7/2001','A3',Null);
h2 := AddItem('Overlaid');
AddBar(h2,'NTask','1/2/2001','1/4/2001','A1',Null);
AddBar(h2,'NTask','1/3/2001','1/5/2001','A2',Null);
AddBar(h2,'NTask','1/4/2001','1/7/2001','A3',Null);
GroupBars(h1,'A1',True,h2,'A1',True,Null,Null);
GroupBars(h1,'A1',False,h2,'A1',False,Null,Null);
GroupBars(h1,'A2',True,h2,'A2',True,Null,Null);
GroupBars(h1,'A2',False,h2,'A2',False,Null,Null);
GroupBars(h1,'A3',True,h2,'A3',True,Null,Null);
GroupBars(h1,'A3',False,h2,'A3',False,Null,Null);
end;
EndUpdate();
end
|
1149
|
Is it possible to layer bars on top of other bars (have different colurs so that they can be seen)
![](images/exg2anttq1149.png)
with G2antt1 do
begin
BeginUpdate();
DefaultItemHeight := 22;
Columns.Add('Task');
with Chart do
begin
PaneWidth[False] := 48;
FirstVisibleDate := '12/28/2000';
LevelCount := 2;
Bars.Copy('Task','NTask').OverlaidType := EXG2ANTTLib_TLB.exOverlaidBarsOffset;
end;
with Items do
begin
h1 := AddItem('Default');
AddBar(h1,'Task','1/2/2001','1/4/2001','A1',Null);
AddBar(h1,'Task','1/3/2001','1/5/2001','A2',Null);
AddBar(h1,'Task','1/4/2001','1/7/2001','A3',Null);
h2 := AddItem('Overlaid');
AddBar(h2,'NTask','1/2/2001','1/4/2001','A1',Null);
AddBar(h2,'NTask','1/3/2001','1/5/2001','A2',Null);
AddBar(h2,'NTask','1/4/2001','1/7/2001','A3',Null);
GroupBars(h1,'A1',True,h2,'A1',True,Null,Null);
GroupBars(h1,'A1',False,h2,'A1',False,Null,Null);
GroupBars(h1,'A2',True,h2,'A2',True,Null,Null);
GroupBars(h1,'A2',False,h2,'A2',False,Null,Null);
GroupBars(h1,'A3',True,h2,'A3',True,Null,Null);
GroupBars(h1,'A3',False,h2,'A3',False,Null,Null);
end;
EndUpdate();
end
|
1148
|
My skin(EBN) bars are not shown a different color in the overview. What can I do
![](images/exg2anttq1148.png)
with G2antt1 do
begin
BeginUpdate();
VisualAppearance.Add(1,'c:\exontrol\images\normal.ebn');
with Chart do
begin
Bars.Item['Task'].Color := $1000000;
PaneWidth[False] := 48;
OverviewVisible := EXG2ANTTLib_TLB.exOverviewShowAllVisible;
FirstVisibleDate := '1/11/2001';
LevelCount := 2;
end;
Columns.Add('Column');
with Items do
begin
h := AddItem('Task 1');
AddBar(h,'Task','1/2/2001','1/4/2001',OleVariant(1),Null);
AddBar(h,'Task','2/2/2001','2/4/2001',OleVariant(2),Null);
ItemBar[h,OleVariant(2),EXG2ANTTLib_TLB.exBarColor] := OleVariant(16776960);
h := AddItem('Task 2');
AddBar(h,'Task','2/2/2001','2/4/2001','',Null);
ItemBar[h,'',EXG2ANTTLib_TLB.exBarColor] := OleVariant(255);
end;
EndUpdate();
end
|
1147
|
How do I colour the lines in the overview section to match the bars they represent on the main chart
![](images/exg2anttq1147.png)
with G2antt1 do
begin
BeginUpdate();
with Chart do
begin
PaneWidth[False] := 48;
OverviewVisible := EXG2ANTTLib_TLB.exOverviewShowAllVisible;
FirstVisibleDate := '1/1/2001';
LevelCount := 2;
end;
Columns.Add('Column');
with Items do
begin
h := AddItem('Task 1');
AddBar(h,'Task','1/2/2001','1/4/2001',OleVariant(1),Null);
AddBar(h,'Task','2/2/2001','2/4/2001',OleVariant(2),Null);
h := AddItem('Task 2');
AddBar(h,'Task','2/2/2001','2/4/2001','',Null);
ItemBar[h,'',EXG2ANTTLib_TLB.exBarColor] := OleVariant(255);
end;
EndUpdate();
end
|
1146
|
How do I catch the delete key (down) on a bar
// KeyDown event - Occurs when the user presses a key while an object has the focus.
procedure TForm1.G2antt1KeyDown(ASender: TObject; var KeyCode : Smallint;Shift : Smallint);
begin
with G2antt1 do
begin
OutputDebugString( KeyCode );
OutputDebugString( Shift );
end
end;
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Task');
with Chart do
begin
FirstVisibleDate := '12/27/2000';
LevelCount := 2;
PaneWidth[False] := 48;
with Bars.Item['Task'] do
begin
Pattern := EXG2ANTTLib_TLB.exPatternBox;
Height := 13;
end;
end;
with Items do
begin
h := AddItem('Task 1');
AddBar(h,'Task','1/2/2001','1/6/2001','K1','This is a bit of text that is not clipped');
h := AddItem('Task 1');
AddBar(h,'Task','1/2/2001','1/6/2001','K1','This is a bit of text that get''s clipped');
ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(3);
ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarToolTip] := ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarCaption];
end;
EndUpdate();
end
|
1145
|
Is it possible to colour a particular column, I mean the cell's foreground color
with G2antt1 do
begin
BeginUpdate();
with ConditionalFormats.Add('1',Null) do
begin
ForeColor := $ff;
ApplyTo := EXG2ANTTLib_TLB.FormatApplyToEnum($1);
end;
MarkSearchColumn := False;
with Columns do
begin
Add('Column 1');
Add('Column 2');
end;
with Items do
begin
CellValue[OleVariant(AddItem(OleVariant(0))),OleVariant(1)] := OleVariant(1);
CellValue[OleVariant(AddItem(OleVariant(2))),OleVariant(1)] := OleVariant(3);
CellValue[OleVariant(AddItem(OleVariant(4))),OleVariant(1)] := OleVariant(5);
end;
EndUpdate();
end
|
1144
|
Is it possible to colour a particular column for specified values
with G2antt1 do
begin
BeginUpdate();
with ConditionalFormats.Add('int(%1) in (3,4,5)',Null) do
begin
BackColor := $ff;
ApplyTo := EXG2ANTTLib_TLB.FormatApplyToEnum($1);
end;
MarkSearchColumn := False;
with Columns do
begin
Add('Column 1');
Add('Column 2');
end;
with Items do
begin
CellValue[OleVariant(AddItem(OleVariant(0))),OleVariant(1)] := OleVariant(1);
CellValue[OleVariant(AddItem(OleVariant(2))),OleVariant(1)] := OleVariant(3);
CellValue[OleVariant(AddItem(OleVariant(4))),OleVariant(1)] := OleVariant(5);
end;
EndUpdate();
end
|
1143
|
Is it possible to colour a particular column
with G2antt1 do
begin
BeginUpdate();
MarkSearchColumn := False;
with Columns do
begin
Add('Column 1');
(IUnknown(Add('Column 2')) as EXG2ANTTLib_TLB.Column).Def[EXG2ANTTLib_TLB.exCellBackColor] := OleVariant(255);
end;
with Items do
begin
CellValue[OleVariant(AddItem(OleVariant(0))),OleVariant(1)] := OleVariant(1);
CellValue[OleVariant(AddItem(OleVariant(2))),OleVariant(1)] := OleVariant(3);
CellValue[OleVariant(AddItem(OleVariant(4))),OleVariant(1)] := OleVariant(5);
end;
EndUpdate();
end
|
1142
|
How do i get all the children items that are under a certain parent Item handle
with G2antt1 do
begin
BeginUpdate();
LinesAtRoot := EXG2ANTTLib_TLB.exLinesAtRoot;
Columns.Add('P');
with Items do
begin
h := AddItem('Root');
InsertItem(h,Null,'Child 1');
InsertItem(h,Null,'Child 2');
ExpandItem[h] := True;
end;
with Items do
begin
hChild := ItemChild[FirstVisibleItem];
OutputDebugString( CellValue[OleVariant(hChild),OleVariant(0)] );
OutputDebugString( CellValue[OleVariant(NextSiblingItem[hChild]),OleVariant(0)] );
end;
EndUpdate();
end
|
1141
|
How can I access the control's scroll bar so I can change its appearance
with G2antt1 do
begin
BeginUpdate();
Chart.PaneWidth[False] := 0;
VisualAppearance.Add(1,'c:\exontrol\images\normal.ebn');
Background[EXG2ANTTLib_TLB.exHSThumb] := $1000000;
EndUpdate();
end
|
1140
|
How can I show my bars using the parts of the current theme
with G2antt1 do
begin
BeginUpdate();
with VisualAppearance do
begin
Add(1,'XP:Button 1 1');
Add(2,'XP:Button 1 2');
Add(3,'XP:ScrollBar 3 1');
Add(4,'XP:ScrollBar 3 2');
end;
with Chart do
begin
PaneWidth[False] := 48;
FirstVisibleDate := '1/1/2001';
with Bars do
begin
Add('B1').Color := $1000000;
Add('B2').Color := $2000000;
Add('S1').Color := $3000000;
Add('S2').Color := $4000000;
end;
end;
Columns.Add('Column');
with Items do
begin
AddBar(AddItem('Button1'),'B1','1/2/2001','1/4/2001',Null,Null);
AddBar(AddItem('Button 2'),'B2','1/2/2001','1/4/2001',Null,Null);
AddBar(AddItem('Scrollbar 1'),'S1','1/2/2001','1/4/2001',Null,Null);
AddBar(AddItem('Scrollbar 2'),'S2','1/2/2001','1/4/2001',Null,Null);
end;
EndUpdate();
end
|
1139
|
How do I hide the text on a bar if the text is to big for the bar length
![](images/exg2anttq1139.png)
with G2antt1 do
begin
Columns.Add('Task');
with Chart do
begin
FirstVisibleDate := '12/27/2000';
LevelCount := 2;
PaneWidth[False] := 48;
with Bars.Item['Task'] do
begin
Pattern := EXG2ANTTLib_TLB.exPatternBox;
Height := 13;
end;
end;
with Items do
begin
h := AddItem('Task 1');
AddBar(h,'Task','1/2/2001','1/6/2001','K1','This is a bit of text that is not clipped');
h := AddItem('Task 1');
AddBar(h,'Task','1/2/2001','1/6/2001','K1','This is a bit of text that get''s clipped');
ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(3);
ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarToolTip] := ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarCaption];
end;
end
|
1138
|
Is it possible to change the color for non-working parts of the bar
![](images/exg2anttq1138.png)
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Task');
with Chart do
begin
LevelCount := 2;
PaneWidth[False] := 48;
FirstVisibleDate := '1/1/2001';
Bars.Add('Task:Split').Shortcut := 'Task';
NonworkingDaysColor := $f0faf0;
end;
with Items do
begin
AddBar(AddItem('Task 1'),'Task','1/2/2001','1/16/2001',Null,Null);
h := AddItem('Task 2');
AddBar(h,'Task','1/2/2001','1/16/2001','',Null);
ItemBar[h,'',EXG2ANTTLib_TLB.exBarNonWorkingColor] := OleVariant(65280);
end;
EndUpdate();
end
|
1137
|
Is it possible to change the color for the percent bar being displayed inside a specified bar only
![](images/exg2anttq1137.png)
with G2antt1 do
begin
Columns.Add('Task');
Chart.FirstVisibleDate := '1/1/2001';
Chart.Bars.Add('Task%Progress');
Chart.PaneWidth[False] := 48;
with Items do
begin
h := AddItem('Task 1');
AddBar(h,'Task%Progress','1/2/2001','1/6/2001','K1',Null);
ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarPercent] := OleVariant(0.4);
h := AddItem('Task 2');
AddBar(h,'Task%Progress','1/2/2001','1/6/2001','K1',Null);
ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarPercent] := OleVariant(0.5);
ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarPercentColor] := OleVariant(255);
end;
end
|
1136
|
How do I get a handle on the item before adding the bar
with G2antt1 do
begin
BeginUpdate();
MarkSearchColumn := False;
OnResizeControl := EXG2ANTTLib_TLB.exResizeChart;
Columns.Add('Tasks');
(IUnknown(Columns.Add('Start')) as EXG2ANTTLib_TLB.Column).Visible := False;
(IUnknown(Columns.Add('End')) as EXG2ANTTLib_TLB.Column).Visible := False;
with Chart do
begin
FirstVisibleDate := '9/20/2006';
PaneWidth[False] := 64;
LevelCount := 2;
end;
with Items do
begin
h1 := AddItem('Task 0');
CellValue[OleVariant(h1),OleVariant(1)] := '9/21/2006';
CellValue[OleVariant(h1),OleVariant(2)] := '9/24/2006';
AddBar(h1,'Task',CellValue[OleVariant(h1),OleVariant(1)],CellValue[OleVariant(h1),OleVariant(2)],Null,Null);
h2 := InsertItem(h,Null,'Task 1');
CellValue[OleVariant(h2),OleVariant(1)] := '9/25/2006';
CellValue[OleVariant(h2),OleVariant(2)] := '9/28/2006';
AddBar(h2,'Task',CellValue[OleVariant(h2),OleVariant(1)],CellValue[OleVariant(h2),OleVariant(2)],Null,Null);
h3 := InsertItem(h,Null,'Task 2');
CellValue[OleVariant(h3),OleVariant(1)] := '9/29/2006';
CellValue[OleVariant(h3),OleVariant(2)] := '10/2/2006';
AddBar(h3,'Task',CellValue[OleVariant(h3),OleVariant(1)],CellValue[OleVariant(h3),OleVariant(2)],Null,Null);
AddItem(OleVariant(ItemCount));
end;
EndUpdate();
end
|
1135
|
Is there an Items method that I can use to loop around to compare the item's user data against
with G2antt1 do
begin
Columns.Add('Default');
with Items do
begin
h := AddItem('Root 1');
InsertItem(h,Null,'Child 1');
ItemData[InsertItem(h,Null,'Child 2')] := OleVariant(1234);
ExpandItem[h] := True;
ItemBold[FindItemData[OleVariant(1234),Null]] := True;
end;
end
|
1134
|
How do I make the tooltip box wider to allow for longer text
![](images/exg2anttq1134.png)
with G2antt1 do
begin
ToolTipWidth := 328;
Columns.Add('Task');
with Chart do
begin
FirstVisibleDate := '1/1/2001';
PaneWidth[False] := 48;
end;
with Items do
begin
h := AddItem('Task 1');
AddBar(h,'Task','1/2/2001','1/4/2001','K1',Null);
ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarToolTip] := 'This is a bit of text that''s displayed when the cursor hovers the bar';
end;
end
|
1133
|
How do i set the default timeslots to say hours or minutes
![](images/exg2anttq1133.png)
with G2antt1 do
begin
BeginUpdate();
with Chart do
begin
FirstVisibleDate := '1/1/2001';
PaneWidth[False] := 48;
OverviewVisible := EXG2ANTTLib_TLB.exOverviewShowAllVisible;
LevelCount := 2;
AllowOverviewZoom := EXG2ANTTLib_TLB.exAlwaysZoom;
OverviewZoomUnit := 24;
OverviewZoomCaption := 'Y|½Y|¼Y|Mo|T|W|D|H|Mi|S';
UnitScale := EXG2ANTTLib_TLB.exMinute;
end;
Columns.Add('Column');
with Items do
begin
AddBar(AddItem('Item 1'),'Task','1/2/2001','1/4/2001',Null,Null);
AddBar(AddItem('Item 2'),'Task','1/16/2001','1/25/2001',Null,Null);
AddBar(AddItem('Item 3'),'Task','1/2/2001','1/4/2001',Null,Null);
AddBar(AddItem('Item 4'),'Task','2/16/2001','2/25/2001',Null,Null);
end;
EndUpdate();
end
|
1132
|
Can I use icons or images in the text in the overview zoom buttons (Sec., Min., Hour, Month...)
![](images/exg2anttq1132.png)
with G2antt1 do
begin
BeginUpdate();
HTMLPicture['pic1'] := 'c:\exontrol\images\zipdisk.gif';
with Chart do
begin
FirstVisibleDate := '1/1/2001';
PaneWidth[False] := 48;
OverviewVisible := EXG2ANTTLib_TLB.exOverviewShowAllVisible;
LevelCount := 2;
AllowOverviewZoom := EXG2ANTTLib_TLB.exAlwaysZoom;
OverviewZoomUnit := 24;
OverviewHeight := 58;
OverviewZoomCaption := 'Y<br>e<br>a<br>r|½Y|¼Y|M<br>o<br>n<br>t<br>h|T|W<br>e<br>e<br>w|<img>pic1:28<img>|H<br>o<br>u<br>r|M<br>i<br>n|S<br>e<br>c';
end;
Columns.Add('Column');
with Items do
begin
AddBar(AddItem('Item 1'),'Task','1/2/2001','1/4/2001',Null,Null);
AddBar(AddItem('Item 2'),'Task','1/16/2001','1/25/2001',Null,Null);
AddBar(AddItem('Item 3'),'Task','1/2/2001','1/4/2001',Null,Null);
AddBar(AddItem('Item 4'),'Task','2/16/2001','2/25/2001',Null,Null);
end;
EndUpdate();
end
|
1131
|
Can I use icons or images in the text in the overview zoom buttons (Sec., Min., Hour, Month...)
![](images/exg2anttq1131.png)
with G2antt1 do
begin
BeginUpdate();
Images('gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTql' +
'Vq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0' +
'ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yN' +
'AOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=');
with Chart do
begin
FirstVisibleDate := '1/1/2001';
PaneWidth[False] := 48;
OverviewVisible := EXG2ANTTLib_TLB.exOverviewShowAllVisible;
LevelCount := 2;
AllowOverviewZoom := EXG2ANTTLib_TLB.exAlwaysZoom;
OverviewZoomUnit := 24;
OverviewZoomCaption := 'Y|½Y|¼Y|<img>2<img>|T|W|<img>1<img>|H|M|S';
end;
Columns.Add('Column');
with Items do
begin
AddBar(AddItem('Item 1'),'Task','1/2/2001','1/4/2001',Null,Null);
AddBar(AddItem('Item 2'),'Task','1/16/2001','1/25/2001',Null,Null);
AddBar(AddItem('Item 3'),'Task','1/2/2001','1/4/2001',Null,Null);
AddBar(AddItem('Item 4'),'Task','2/16/2001','2/25/2001',Null,Null);
end;
EndUpdate();
end
|
1130
|
How do I change (for localisation) the text in the buttons like (Sec., Min., Hour, Month...)
with G2antt1 do
begin
BeginUpdate();
with Chart do
begin
FirstVisibleDate := '1/1/2001';
PaneWidth[False] := 48;
OverviewVisible := EXG2ANTTLib_TLB.exOverviewShowAllVisible;
LevelCount := 2;
AllowOverviewZoom := EXG2ANTTLib_TLB.exAlwaysZoom;
OverviewZoomUnit := 24;
OverviewZoomCaption := 'Y|½Y|¼Y|Mo|T|W|D|H|Mi|S';
end;
Columns.Add('Column');
with Items do
begin
AddBar(AddItem('Item 1'),'Task','1/2/2001','1/4/2001',Null,Null);
AddBar(AddItem('Item 2'),'Task','1/16/2001','1/25/2001',Null,Null);
AddBar(AddItem('Item 3'),'Task','1/2/2001','1/4/2001',Null,Null);
AddBar(AddItem('Item 4'),'Task','2/16/2001','2/25/2001',Null,Null);
end;
EndUpdate();
end
|
1129
|
How I can change the Months and Weekdays
![](images/exg2anttq1129.png)
with G2antt1 do
begin
BeginUpdate();
with Chart do
begin
PaneWidth[False] := 0;
FirstVisibleDate := '2/1/2010';
LevelCount := 2;
UnitWidth := 10;
MonthNames := '1 2 3 4 5 6 7 8 9 10 11 12';
WeekDays := 'A B C D E F G';
with Level[0] do
begin
Label := '<%mmmm%>';
Unit := EXG2ANTTLib_TLB.exMonth;
end;
with Level[1] do
begin
Label := '<font ;6><%ddd%>';
Unit := EXG2ANTTLib_TLB.exDay;
end;
end;
EndUpdate();
end
|
1128
|
How do i get the current window time frame (the start and end) of the gantt chart
// DateChange event - Occurs when the first visible date is changed.
procedure TForm1.G2antt1DateChange(ASender: TObject; );
begin
with G2antt1 do
begin
with Chart do
begin
OutputDebugString( 'Start' );
OutputDebugString( FirstVisibleDate );
OutputDebugString( '' );
OutputDebugString( 'End' );
OutputDebugString( DateFromPoint[PaneWidth[True],0] );
end;
end
end;
with G2antt1 do
begin
BeginUpdate();
with Chart do
begin
PaneWidth[False] := 1;
LevelCount := 2;
ScrollTo('1/1/2010',OleVariant(0));
end;
EndUpdate();
end
|
1127
|
When I use this Chart.get_DateFromPoint(exg2antt1.Width, 0) I get date as 0, 30/12/1899, or 12:00:00 AM. What that means
// MouseMove event - Occurs when the user moves the mouse.
procedure TForm1.G2antt1MouseMove(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer);
begin
with G2antt1 do
begin
OutputDebugString( Chart.DateFromPoint[-1,-1] );
end
end;
with G2antt1 do
begin
with Chart do
begin
PaneWidth[False] := 48;
LevelCount := 2;
end;
end
|
1126
|
How do I enable grabing bars to other items/rows (and only enable them to be dropped on certain rows)
// BarParentChange event - Occurs just before moving a bar from current item to another item.
procedure TForm1.G2antt1BarParentChange(ASender: TObject; Item : HITEM;Key : OleVariant;NewItem : HITEM;var Cancel : WordBool);
begin
with G2antt1 do
begin
OutputDebugString( Items.CellCaption[OleVariant(NewItem),OleVariant(0)] );
Cancel := Items.ItemData[NewItem];
end
end;
with G2antt1 do
begin
BeginUpdate();
with Chart do
begin
FirstVisibleDate := '1/1/2001';
PaneWidth[False] := 48;
AllowLinkBars := False;
Bars.Item['Task'].OverlaidType := Integer(EXG2ANTTLib_TLB.exOverlaidBarsTransparent) Or Integer(EXG2ANTTLib_TLB.exOverlaidBarsOffset);
end;
Columns.Add('Column');
with Items do
begin
h := AddItem('Item 1');
EnableItem[h] := False;
ItemData[h] := OleVariant(-1);
h := AddItem('Item 2');
ItemData[h] := OleVariant(0);
AddBar(h,'Task','1/5/2001','1/7/2001','B',Null);
ItemBar[h,'B',EXG2ANTTLib_TLB.exBarCanMoveToAnother] := OleVariant(True);
ItemData[AddItem('Item 3')] := OleVariant(0);
h := AddItem('Item 4');
EnableItem[h] := False;
ItemData[h] := OleVariant(-1);
end;
EndUpdate();
end
|
1125
|
How can I find out if a date time is a non-working part
// MouseMove event - Occurs when the user moves the mouse.
procedure TForm1.G2antt1MouseMove(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer);
begin
with G2antt1 do
begin
h := ItemFromPoint[-1,-1,c,hit];
d := Chart.DateFromPoint[-1,-1];
OutputDebugString( d );
OutputDebugString( Chart.IsNonworkingDate[OleVariant(d),OleVariant(h)] );
end
end;
with G2antt1 do
begin
BeginUpdate();
Columns.Add('NonWorking');
with Chart do
begin
FirstWeekDay := EXG2ANTTLib_TLB.exMonday;
FirstVisibleDate := '1/24/2008';
PaneWidth[False] := 64;
LevelCount := 2;
end;
with Items do
begin
h := AddItem('Default');
h := AddItem('January');
ItemNonworkingUnits[h,OleVariant(False)] := 'month(value) = 1';
h := AddItem('February, Saturday, Sunday');
ItemNonworkingUnits[h,OleVariant(False)] := 'month(value) = 2 or (weekday(value) = 0 or weekday(value) = 6)';
h := AddItem('Sunday');
ItemNonworkingUnits[h,OleVariant(False)] := 'weekday(value) = 0';
end;
EndUpdate();
end
|
1124
|
I am using the ItemBar property exBarCanMoveToAnother, How do I stop it from being dropped on certain chart rows
// BarParentChange event - Occurs just before moving a bar from current item to another item.
procedure TForm1.G2antt1BarParentChange(ASender: TObject; Item : HITEM;Key : OleVariant;NewItem : HITEM;var Cancel : WordBool);
begin
with G2antt1 do
begin
OutputDebugString( Items.CellCaption[OleVariant(NewItem),OleVariant(0)] );
Cancel := Items.ItemData[NewItem];
end
end;
with G2antt1 do
begin
BeginUpdate();
with Chart do
begin
FirstVisibleDate := '1/1/2001';
PaneWidth[False] := 48;
AllowLinkBars := False;
Bars.Item['Task'].OverlaidType := Integer(EXG2ANTTLib_TLB.exOverlaidBarsTransparent) Or Integer(EXG2ANTTLib_TLB.exOverlaidBarsOffset);
end;
Columns.Add('Column');
with Items do
begin
h := AddItem('Item 1');
EnableItem[h] := False;
ItemData[h] := OleVariant(-1);
h := AddItem('Item 2');
ItemData[h] := OleVariant(0);
AddBar(h,'Task','1/5/2001','1/7/2001','B',Null);
ItemBar[h,'B',EXG2ANTTLib_TLB.exBarCanMoveToAnother] := OleVariant(True);
ItemData[AddItem('Item 3')] := OleVariant(0);
ItemData[AddItem('Item 4')] := OleVariant(0);
end;
EndUpdate();
end
|
1123
|
What is the event I should use to capture the click event on the task item on left hand side
// Click event - Occurs when the user presses and then releases the left mouse button over the tree control.
procedure TForm1.G2antt1Click(ASender: TObject; );
begin
with G2antt1 do
begin
h := ItemFromPoint[-1,-1,c,hit];
OutputDebugString( Items.CellCaption[OleVariant(h),OleVariant(c)] );
end
end;
with G2antt1 do
begin
BeginUpdate();
LinesAtRoot := EXG2ANTTLib_TLB.exLinesAtRoot;
Columns.Add('Items');
with Items do
begin
h := AddItem('R1');
InsertItem(h,Null,'Cell 1.1');
InsertItem(h,Null,'Cell 1.2');
ExpandItem[h] := True;
h := AddItem('R2');
InsertItem(h,Null,'Cell 2.1');
InsertItem(h,Null,'Cell 2.2');
ExpandItem[h] := True;
end;
EndUpdate();
end
|
1122
|
Can I add a hyperlink assigned to a bar
![](images/exg2anttq1122.png)
// AnchorClick event - Occurs when an anchor element is clicked.
procedure TForm1.G2antt1AnchorClick(ASender: TObject; AnchorID : WideString;Options : WideString);
begin
with G2antt1 do
begin
OutputDebugString( AnchorID );
end
end;
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Task');
with Chart do
begin
FirstVisibleDate := '1/1/2001';
PaneWidth[False] := 48;
end;
with Items do
begin
h := AddItem('Task 1');
AddBar(h,'Task','1/2/2001','1/6/2001','K',Null);
ItemBar[h,'K',EXG2ANTTLib_TLB.exBarCaption] := 'default';
ItemBar[h,'K',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(18);
h := AddItem('Task 2');
AddBar(h,'Task','1/2/2001','1/6/2001','K',Null);
ItemBar[h,'K',EXG2ANTTLib_TLB.exBarCaption] := '<a1><b>A 1</b></a>';
ItemBar[h,'K',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(18);
h := AddItem('Task 3');
AddBar(h,'Task','1/2/2001','1/6/2001','K',Null);
ItemBar[h,'K',EXG2ANTTLib_TLB.exBarCaption] := '<a2><b>A 2</b></a>';
ItemBar[h,'K',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(18);
end;
EndUpdate();
end
|
1121
|
Can I change the background color only for the text (caption) in a bar
![](images/exg2anttq1121.png)
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Task');
with Chart do
begin
FirstVisibleDate := '1/1/2001';
PaneWidth[False] := 48;
end;
with Items do
begin
h := AddItem('Task 1');
AddBar(h,'Task','1/2/2001','1/6/2001','K',Null);
ItemBar[h,'K',EXG2ANTTLib_TLB.exBarCaption] := 'default';
ItemBar[h,'K',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(18);
h := AddItem('Task 2');
AddBar(h,'Task','1/2/2001','1/6/2001','K',Null);
ItemBar[h,'K',EXG2ANTTLib_TLB.exBarCaption] := 'using <bgcolor=FF0000>bgcolor</bgcolor> HTML attribute ';
ItemBar[h,'K',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(18);
end;
EndUpdate();
end
|
1120
|
Can I change the font to display the text (caption) in a bar
![](images/exg2anttq1120.png)
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Task');
with Chart do
begin
FirstVisibleDate := '1/1/2001';
PaneWidth[False] := 48;
end;
with Items do
begin
h := AddItem('Task 1');
AddBar(h,'Task','1/2/2001','1/6/2001','K',Null);
ItemBar[h,'K',EXG2ANTTLib_TLB.exBarCaption] := 'default';
ItemBar[h,'K',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(18);
h := AddItem('Task 2');
AddBar(h,'Task','1/2/2001','1/6/2001','K',Null);
ItemBar[h,'K',EXG2ANTTLib_TLB.exBarCaption] := '<font Segoe UI;8 >using font HTML attribute </fgcolor>';
ItemBar[h,'K',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(18);
end;
EndUpdate();
end
|
1119
|
How do i change the forecolor of text (caption) in a bar
![](images/exg2anttq1119.png)
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Task');
with Chart do
begin
FirstVisibleDate := '1/1/2001';
PaneWidth[False] := 48;
end;
with Items do
begin
h := AddItem('Task 1');
AddBar(h,'Task','1/2/2001','1/6/2001','K',Null);
ItemBar[h,'K',EXG2ANTTLib_TLB.exBarCaption] := 'default';
ItemBar[h,'K',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(18);
h := AddItem('Task 2');
AddBar(h,'Task','1/2/2001','1/6/2001','K',Null);
ItemBar[h,'K',EXG2ANTTLib_TLB.exBarCaption] := '<fgcolor=FF0000>using fgcolor HTML attribute </fgcolor>';
ItemBar[h,'K',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(18);
h := AddItem('Task 3');
AddBar(h,'Task','1/2/2001','1/6/2001','K',Null);
ItemBar[h,'K',EXG2ANTTLib_TLB.exBarCaption] := 'using exBarForeColor';
ItemBar[h,'K',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(18);
ItemBar[h,'K',EXG2ANTTLib_TLB.exBarForeColor] := OleVariant(65280);
end;
EndUpdate();
end
|
1118
|
I have noticed that when scrolling horizontally the chart a tooltip shown. is it possible to actually do the scrolling without showing the tooltip
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Tasks');
with Chart do
begin
FirstVisibleDate := '6/20/2005';
AllowLinkBars := True;
LevelCount := 2;
PaneWidth[False] := 48;
ToolTip := '';
end;
with Items do
begin
AddBar(AddItem('Task 1'),'Task','6/21/2005','6/25/2005','A',Null);
AddBar(AddItem('Task 2'),'Task','6/28/2005','7/2/2005','B',Null);
end;
EndUpdate();
end
|
1117
|
How can I add a bar to be treated as a nonworking part like a "holidays" bar
![](images/exg2anttq1117.png)
with G2antt1 do
begin
BeginUpdate();
with Chart do
begin
FirstVisibleDate := '1/1/2001';
LevelCount := 2;
PaneWidth[False] := 48;
AllowNonworkingBars := True;
Bars.Add('Task:Split').Shortcut := 'Task';
end;
Columns.Add('Tasks');
with Items do
begin
h := AddItem('Task 1');
ItemNonworkingUnits[h,OleVariant(False)] := 'weekday(value) in (0,6)';
AddBar(h,'','1/2/2001','1/5/2001','A','holyday');
ItemBar[h,'A',EXG2ANTTLib_TLB.exBarTreatAsNonworking] := OleVariant(True);
AddBar(h,'Task','1/5/2001','1/12/2001','Z',Null);
ItemBar[h,'Z',EXG2ANTTLib_TLB.exBarKeepWorkingCount] := OleVariant(True);
end;
EndUpdate();
end
|
1116
|
Is it possible to add bars that act like a non-working fixed part or the item
![](images/exg2anttq1116.png)
with G2antt1 do
begin
BeginUpdate();
with Chart do
begin
FirstVisibleDate := '1/1/2001';
LevelCount := 2;
PaneWidth[False] := 48;
AllowNonworkingBars := True;
end;
Columns.Add('Tasks');
with Items do
begin
h := AddItem('Task 1');
ItemNonworkingUnits[h,OleVariant(False)] := 'weekday(value) in (0,6)';
AddBar(h,'','1/3/2001','1/6/2001','h','holyday');
ItemBar[h,'h',EXG2ANTTLib_TLB.exBarTreatAsNonworking] := OleVariant(True);
ItemBar[h,'h',EXG2ANTTLib_TLB.exBarSelectable] := OleVariant(False);
end;
EndUpdate();
end
|
1115
|
Is it possible to add bars that act like a non-working part or the item
![](images/exg2anttq1115.png)
with G2antt1 do
begin
BeginUpdate();
with Chart do
begin
FirstVisibleDate := '1/1/2001';
LevelCount := 2;
PaneWidth[False] := 48;
AllowNonworkingBars := True;
end;
Columns.Add('Tasks');
with Items do
begin
h := AddItem('Task 1');
ItemNonworkingUnits[h,OleVariant(False)] := 'weekday(value) in (0,6)';
AddBar(h,'','1/3/2001','1/6/2001','h','holyday');
ItemBar[h,'h',EXG2ANTTLib_TLB.exBarTreatAsNonworking] := OleVariant(True);
end;
EndUpdate();
end
|
1114
|
How can I change the both dates for the bar at once
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Tasks');
with Chart do
begin
PaneWidth[False] := 64;
FirstVisibleDate := '6/21/2005';
ShowEmptyBars := 1;
end;
with Items do
begin
h := AddItem('Test');
AddBar(h,'Task','6/22/2005','6/26/2005','',Null);
AddBar(h,'Task','6/27/2005','6/29/2005',Null,Null);
end;
EndUpdate();
end
|
1113
|
How can I get the selected bars in the chart
![](images/exg2anttq1113.png)
// ChartSelectionChanged event - Occurs when the user selects objects in the chart area.
procedure TForm1.G2antt1ChartSelectionChanged(ASender: TObject; );
begin
with G2antt1 do
begin
OutputDebugString( Items.SelectedObjects[EXG2ANTTLib_TLB.exSelectBarsOnly] );
end
end;
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Tasks');
with Chart do
begin
FirstVisibleDate := '6/20/2005';
AllowLinkBars := True;
LevelCount := 2;
PaneWidth[False] := 48;
end;
with Items do
begin
AddBar(AddItem('Task 1'),'Task','6/21/2005','6/25/2005','A',Null);
AddBar(AddItem('Task 2'),'Task','6/28/2005','7/2/2005','B',Null);
ItemBar[FirstVisibleItem,FirstItemBar[FirstVisibleItem],EXG2ANTTLib_TLB.exBarSelected] := OleVariant(True);
end;
EndUpdate();
end
|
1112
|
How can I list the actions that can be performed by undo operations
// ChartEndChanging event - Occurs after the chart has been changed.
procedure TForm1.G2antt1ChartEndChanging(ASender: TObject; Operation : BarOperationEnum);
begin
with G2antt1 do
begin
OutputDebugString( Chart.UndoListAction[Null,Null] );
end
end;
with G2antt1 do
begin
BeginUpdate();
Chart.FirstVisibleDate := '1/1/2001';
Chart.AllowLinkBars := False;
Chart.Bars.Item['Task'].OverlaidType := Integer(EXG2ANTTLib_TLB.exOverlaidBarsTransparent) Or Integer(EXG2ANTTLib_TLB.exOverlaidBarsOffset);
Chart.AllowUndoRedo := True;
Chart.PaneWidth[False] := 32;
Chart.Bars.Add('Task:Split').Shortcut := 'Task';
Columns.Add('Column');
with Items do
begin
AddBar(AddItem('Item 1'),'Task','1/2/2001','1/4/2001','A',Null);
h := AddItem('Item 2');
AddBar(h,'Task','1/5/2001','1/9/2001','B',Null);
ItemBar[h,'B',EXG2ANTTLib_TLB.exBarCanMoveToAnother] := OleVariant(True);
ItemBar[h,'B',EXG2ANTTLib_TLB.exBarKeepWorkingCount] := OleVariant(True);
ItemNonworkingUnits[AddItem('Item 3'),OleVariant(False)] := 'weekday(value)=0';
ItemNonworkingUnits[AddItem('Item 4'),OleVariant(False)] := 'weekday(value) in (3,5)';
end;
EndUpdate();
end
|
1111
|
How can I change the predefined labels being displayed in the chart's header so it shows the data in short format with no literals
![](images/exg2anttq1111.png)
with G2antt1 do
begin
BeginUpdate();
with Chart do
begin
PaneWidth[False] := 0;
AllowOverviewZoom := EXG2ANTTLib_TLB.exAlwaysZoom;
OverviewVisible := EXG2ANTTLib_TLB.exOverviewShowAllVisible;
LevelCount := 3;
Label[EXG2ANTTLib_TLB.exYear] := '<%yy%><|><%yyyy%>';
Label[EXG2ANTTLib_TLB.exHalfYear] := '';
Label[EXG2ANTTLib_TLB.exQuarterYear] := '';
Label[EXG2ANTTLib_TLB.exMonth] := '<|><%m%><|><%m%>/<%yy%><|><%m%>/<%yyyy%>';
Label[EXG2ANTTLib_TLB.exThirdMonth] := '';
Label[EXG2ANTTLib_TLB.exWeek] := '<|><%ww%><|><%m%>/<%d%>/<%yy%><r><%ww%><|><%m%>/<%d%>/<%yyyy%><r><%ww%><||><||>256';
Label[EXG2ANTTLib_TLB.exDay] := '<|><%d%><|><%m%>/<%d%>/<%yy%><|><%m%>/<%d%>/<%yyyy%><||><||>4096';
Label[EXG2ANTTLib_TLB.exHour] := '<|><%hh%><|><%m%>/<%d%>/<%yy%> <%h%> <%AM/PM%><|><%m%>/<%d%>/<%yyyy%> <%h%> <%AM/PM%><||><||>65536';
Label[EXG2ANTTLib_TLB.exMinute] := '<|><%nn%><|><%h%>:<%nn% <%AM/PM%>><|><%m%>/<%d%>/<%yy%> <%h%>:<%nn%> <%AM/PM%><|><%m%>/<%d%>/<%yyyy%> <%h%>:<%nn%> <%AM/PM%>';
Label[EXG2ANTTLib_TLB.exSecond] := '<|><%ss%><|><%nn%>:<%ss%><|><%h%>:<%nn%>:<%ss%> <%AM/PM%><|><%m%>/<%d%>/<%yy%> <%h%>:<%nn%>:<%ss%> <%AM/PM%><|><%m%>/<%d%>/<%yyy' +
'y%> <%h%>:<%nn%>:<%ss%> <%AM/PM%>';
LabelToolTip[EXG2ANTTLib_TLB.exYear] := '<%yyyy%>';
LabelToolTip[EXG2ANTTLib_TLB.exHalfYear] := '';
LabelToolTip[EXG2ANTTLib_TLB.exQuarterYear] := '';
LabelToolTip[EXG2ANTTLib_TLB.exMonth] := '<%m%>/<%yyyy%>';
LabelToolTip[EXG2ANTTLib_TLB.exThirdMonth] := '';
LabelToolTip[EXG2ANTTLib_TLB.exWeek] := '<%m%>/<%d%>/<%yyyy%> <%ww%>';
LabelToolTip[EXG2ANTTLib_TLB.exDay] := '<%m%>/<%d%>/<%yyyy%>';
LabelToolTip[EXG2ANTTLib_TLB.exHour] := '<%m%>/<%d%>/<%yyyy%> <%h%> <%AM/PM%>';
LabelToolTip[EXG2ANTTLib_TLB.exMinute] := '<%m%>/<%d%>/<%yyyy%> <%h%>:<%nn%> <%AM/PM%>';
LabelToolTip[EXG2ANTTLib_TLB.exSecond] := '<%m%>/<%d%>/<%yyyy%> <%h%>:<%nn%>:<%ss%> <%AM/PM%>';
UnitScale := EXG2ANTTLib_TLB.exDay;
end;
EndUpdate();
end
|
1110
|
The histogram does not show (correctly) the bars, even if I changed the Bar.HistogramPattern and Bar.HistogramColor properties. What can be wrong
![](images/exg2anttq1110.png)
with G2antt1 do
begin
BeginUpdate();
with Chart do
begin
PaneWidth[False] := 48;
FirstVisibleDate := '12/27/2000';
HistogramVisible := True;
HistogramHeight := 32;
with Bars.Item['Task'] do
begin
HistogramPattern := EXG2ANTTLib_TLB.exPatternBDiagonal;
HistogramColor := $ff;
end;
ResizeUnitScale := EXG2ANTTLib_TLB.exHour;
end;
Columns.Add('Column');
with Items do
begin
AddBar(AddItem('Task 1'),'Task','1/2/2001 8:00:00 AM','1/2/2001 12:00:00 PM',Null,Null);
AddBar(AddItem('Task 2'),'Task','1/1/2001 8:00:00 AM','1/5/2001 12:00:00 PM',Null,Null);
end;
EndUpdate();
end
|
1109
|
How can I change the default key for the newly added link from "Link1" to my identifier
// AddLink event - Occurs when the user links two bars using the mouse.
procedure TForm1.G2antt1AddLink(ASender: TObject; LinkKey : WideString);
begin
with G2antt1 do
begin
with Items do
begin
AddLink('newIDlink',Link[OleVariant(LinkKey),EXG2ANTTLib_TLB.exLinkStartItem],Link[OleVariant(LinkKey),EXG2ANTTLib_TLB.exLinkStartBar],Link[OleVariant(LinkKey),EXG2ANTTLib_TLB.exLinkEndItem],Link[OleVariant(LinkKey),EXG2ANTTLib_TLB.exLinkEndBar]);
RemoveLink(OleVariant(LinkKey));
end;
end
end;
// MouseMove event - Occurs when the user moves the mouse.
procedure TForm1.G2antt1MouseMove(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer);
begin
with G2antt1 do
begin
OutputDebugString( Chart.LinkFromPoint[-1,-1] );
end
end;
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Tasks');
with Chart do
begin
FirstVisibleDate := '6/20/2005';
AllowLinkBars := True;
LevelCount := 2;
PaneWidth[False] := 48;
end;
with Items do
begin
AddBar(AddItem('Task 1'),'Task','6/21/2005','6/25/2005','',Null);
AddBar(AddItem('Task 2'),'Task','6/28/2005','7/2/2005','',Null);
end;
EndUpdate();
end
|
1108
|
How can I change the default key for the newly added link from "Link1" to my identifier
// AllowLink event - Notifies at runtime when a link between two bars is possible.
procedure TForm1.G2antt1AllowLink(ASender: TObject; StartItem : HITEM;StartBarKey : OleVariant;EndItem : HITEM;EndBarKey : OleVariant;var LinkKey : OleVariant;var Cancel : WordBool);
begin
with G2antt1 do
begin
LinkKey := 'newIDlink';
end
end;
// MouseMove event - Occurs when the user moves the mouse.
procedure TForm1.G2antt1MouseMove(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer);
begin
with G2antt1 do
begin
OutputDebugString( Chart.LinkFromPoint[-1,-1] );
end
end;
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Tasks');
with Chart do
begin
FirstVisibleDate := '6/20/2005';
AllowLinkBars := True;
LevelCount := 2;
PaneWidth[False] := 48;
end;
with Items do
begin
AddBar(AddItem('Task 1'),'Task','6/21/2005','6/25/2005','',Null);
AddBar(AddItem('Task 2'),'Task','6/28/2005','7/2/2005','',Null);
end;
EndUpdate();
end
|
1107
|
We want to have a Task ID column as the first column that shows the row number. How can we do that
// FormatColumn event - Fired when a cell requires to format its caption.
procedure TForm1.G2antt1FormatColumn(ASender: TObject; Item : HITEM;ColIndex : Integer;var Value : OleVariant);
begin
with G2antt1 do
begin
Value := Items.ItemPosition[Item];
end
end;
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Task');
with (IUnknown(Columns.Add('Pos')) as EXG2ANTTLib_TLB.Column) do
begin
Width := 24;
AllowSizing := False;
Position := 0;
FireFormatColumn := True;
end;
with Items do
begin
AddItem('Task A');
AddItem('Task B');
AddItem('Task C');
AddItem('Task D');
end;
EndUpdate();
end
|
1106
|
How can I get the caption of focused item
// SelectionChanged event - Fired after a new item has been selected.
procedure TForm1.G2antt1SelectionChanged(ASender: TObject; );
begin
with G2antt1 do
begin
with Items do
begin
OutputDebugString( 'Handle' );
OutputDebugString( FocusItem );
OutputDebugString( 'Caption' );
OutputDebugString( CellCaption[OleVariant(FocusItem),OleVariant(0)] );
end;
end
end;
with G2antt1 do
begin
BeginUpdate();
LinesAtRoot := EXG2ANTTLib_TLB.exLinesAtRoot;
Columns.Add('Items');
with Items do
begin
h := AddItem('R1');
InsertItem(h,Null,'Cell 1.1');
InsertItem(h,Null,'Cell 1.2');
ExpandItem[h] := True;
h := AddItem('R2');
InsertItem(h,Null,'Cell 2.1');
InsertItem(h,Null,'Cell 2.2');
ExpandItem[h] := True;
end;
EndUpdate();
end
|
1105
|
How can I get the caption of selected item
// SelectionChanged event - Fired after a new item has been selected.
procedure TForm1.G2antt1SelectionChanged(ASender: TObject; );
begin
with G2antt1 do
begin
with Items do
begin
OutputDebugString( 'Handle' );
OutputDebugString( SelectedItem[0] );
OutputDebugString( 'Caption' );
OutputDebugString( CellCaption[OleVariant(SelectedItem[0]),OleVariant(0)] );
end;
end
end;
with G2antt1 do
begin
BeginUpdate();
LinesAtRoot := EXG2ANTTLib_TLB.exLinesAtRoot;
Columns.Add('Items');
with Items do
begin
h := AddItem('R1');
InsertItem(h,Null,'Cell 1.1');
InsertItem(h,Null,'Cell 1.2');
ExpandItem[h] := True;
h := AddItem('R2');
InsertItem(h,Null,'Cell 2.1');
InsertItem(h,Null,'Cell 2.2');
ExpandItem[h] := True;
end;
EndUpdate();
end
|
1104
|
How can I get the link from the point
![](images/exg2anttq1104.png)
// MouseMove event - Occurs when the user moves the mouse.
procedure TForm1.G2antt1MouseMove(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer);
begin
with G2antt1 do
begin
OutputDebugString( Chart.LinkFromPoint[-1,-1] );
end
end;
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Task');
with Chart do
begin
FirstVisibleDate := '12/29/2000';
PaneWidth[False] := 64;
LevelCount := 2;
end;
with Items do
begin
h1 := AddItem('Task 1');
AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null);
h2 := AddItem('Task 2');
AddBar(h2,'Task','1/5/2001','1/7/2001','K2',Null);
AddLink('L1',h1,'K1',h2,'K2');
Link['L1',EXG2ANTTLib_TLB.exLinkText] := 'L1';
h3 := AddItem('Task 3');
AddBar(h3,'Task','1/8/2001','1/10/2001','K3',Null);
AddLink('L2',h2,'K2',h3,'K3');
Link['L2',EXG2ANTTLib_TLB.exLinkText] := 'L2';
end;
EndUpdate();
end
|
1103
|
How can I get the bar from the point
![](images/exg2anttq1103.png)
// MouseMove event - Occurs when the user moves the mouse.
procedure TForm1.G2antt1MouseMove(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer);
begin
with G2antt1 do
begin
OutputDebugString( Chart.BarFromPoint[-1,-1] );
end
end;
with G2antt1 do
begin
BeginUpdate();
Columns.Add('Task');
with Chart do
begin
FirstVisibleDate := '12/29/2000';
PaneWidth[False] := 64;
LevelCount := 2;
end;
with Items do
begin
h1 := AddItem('Task 1');
AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null);
h2 := AddItem('Task 2');
AddBar(h2,'Task','1/4/2001','1/6/2001','K2',Null);
AddLink('L1',h1,'K1',h2,'K2');
h3 := AddItem('Task 3');
AddBar(h3,'Task','1/8/2001','1/10/2001','K3',Null);
AddLink('L2',h2,'K2',h3,'K3');
end;
EndUpdate();
end
|
1102
|
How can I get the level from the cursor
![](images/exg2anttq1102.png)
// MouseMove event - Occurs when the user moves the mouse.
procedure TForm1.G2antt1MouseMove(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer);
begin
with G2antt1 do
begin
OutputDebugString( Chart.LevelFromPoint[-1,-1] );
end
end;
with G2antt1 do
begin
with Chart do
begin
FirstVisibleDate := '6/25/2010';
PaneWidth[False] := 0;
LevelCount := 4;
end;
end
|
1101
|
How can I get the date from the cursor
![](images/exg2anttq1101.png)
// MouseMove event - Occurs when the user moves the mouse.
procedure TForm1.G2antt1MouseMove(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer);
begin
with G2antt1 do
begin
OutputDebugString( Chart.DateFromPoint[-1,-1] );
end
end;
with G2antt1 do
begin
with Chart do
begin
PaneWidth[False] := 0;
LevelCount := 2;
end;
end
|